Inheritance diagram for ComboBox:
Properties | |
ULONG RW | DropDownCount [] |
Specifies how many items can be displayed in the listbox before a scrollbar control becomes necessary. | |
LONG RW | Style [] |
Specifies the style of the window. | |
LONG RW | CharCase [] |
Specifies convertion of characters to lowercase or uppercase. | |
VARIANT_BOOL RW | ReadOnly [] |
Use this property to prevent the user from typing or editing text in the edit control. | |
VARIANT_BOOL RW | DroppedDown [] |
Specifies when the listbox visible (Style must be CBS_DROPDOWN or CBS_DROPDOWNLIST). | |
BSTR RW | CueBanner [] |
Specifies the cue banner text. | |
VARIANT_BOOL RW | CueBannerAlwaysVisible [] |
If specified true then the cue banner (specified by CueBanner) will be visible even when the control has focus. | |
IDispatch *R | BalloonTip [] |
Returns BalloonTip object for configuration an Balloon Tip options. | |
VARIANT W | OnDropDown [] |
Sets the event handler for the OnDropDown event. |
A ComboBox allows the user to select items from the list or to enter new text.
When the user changes selection, the OnChange event occur.
See also the method CreateComboBox of the Frame.
Example 1 (JScript):
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 100 f.CenterControl() ComboBox = f.CreateComboBox(10,10,100,25) with (ComboBox) { Add("Item 1") Add("Item 2") Add("Item 3") Add("Item 4") Add("Item 5") } f.Show() o.Run()
Example 2 (JScript):
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 120 f.CenterControl() ComboBox = f.CreateComboBox(10,10,100,100) ComboBox.Images.Load(CurrentDir()+"ToolBar.bmp") for (i = 0; i<5; i++) { ComboBox.Add("Item "+i) ComboBox.ImageIndex(i) = i } f.Show() o.Run() function CurrentDir() {s = WScript.ScriptFullName; s = s.substring(0,s.lastIndexOf("\\")+1); return s; }
IDispatch* R BalloonTip |
Returns BalloonTip object for configuration an Balloon Tip options.
Minimum OS: Windows XP. Requires visual styles (Themes).
LONG RW CharCase |
Specifies convertion of characters to lowercase or uppercase.
This parameter can be a one of the following values:
BSTR RW CueBanner |
Specifies the cue banner text.
Minimum OS: Windows XP. Requires visual styles (Themes).
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 120 f.CenterControl() ComboBox = f.CreateComboBox(10,10,180,100) ComboBox.CueBanner = "Enter text where" for (i = 0; i<5; i++) { ComboBox.Add("Item "+i) } f.CreateButton(10,40,75,25,"OK") f.Show() o.Run()
VARIANT_BOOL RW CueBannerAlwaysVisible |
ULONG RW DropDownCount |
Specifies how many items can be displayed in the listbox before a scrollbar control becomes necessary.
Default: 30.
Example 1 (JScript, CBS_DROPDOWN):
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 170 f.CenterControl() ComboBox = f.CreateComboBox(10,10,100,25,o.Translate("CBS_DROPDOWNLIST")) ComboBox.DropDownCount = 10 for (i = 0; i<50; i++) ComboBox.Add("Item "+i) f.Show() o.Run()
VARIANT_BOOL RW DroppedDown |
Specifies when the listbox visible (Style must be CBS_DROPDOWN or CBS_DROPDOWNLIST).
VARIANT W OnDropDown |
Sets the event handler for the OnDropDown event.
VARIANT_BOOL RW ReadOnly |
Use this property to prevent the user from typing or editing text in the edit control.
LONG RW Style |
Specifies the style of the window.
This parameter can be a one of the following values:
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 100 f.CenterControl() ComboBox = f.CreateComboBox(10,10,100,25) with (ComboBox) { Add("Item 1") Add("Item 2") Add("Item 3") Add("Item 4") Add("Item 5") } f.Show() o.Run()
Example 2 (JScript, CBS_DROPDOWNLIST):
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 120 f.CenterControl() ComboBox = f.CreateComboBox(10,10,100,25,o.Translate("CBS_DROPDOWNLIST")) with (ComboBox) { Add("Item 1") Add("Item 2") Add("Item 3") Add("Item 4") Add("Item 5") } f.Show() o.Run()
Example 3 (JScript, CBS_SIMPLE):
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 120 f.CenterControl() ComboBox = f.CreateComboBox(10,10,100,100,o.Translate("CBS_SIMPLE")) with (ComboBox) { Add("Item 1") Add("Item 2") Add("Item 3") Add("Item 4") Add("Item 5") } f.Show() o.Run()