ComboBox Interface Reference

ComboBox control displays a text edit control combined with a ListBox control. More...

Inheritance diagram for ComboBox:

Inheritance graph
Collaboration diagram for ComboBox:

Collaboration graph
List of all members.

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.

Detailed Description

ComboBox control displays a text edit control combined with a ListBox control.

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()

Result:

ComboBox.jpg

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; }

Result:

ComboBox_Images.jpg


Property Documentation

IDispatch* R BalloonTip

Returns BalloonTip object for configuration an Balloon Tip options.

Minimum OS: Windows XP. Requires visual styles (Themes).

Since:
1.1.8.
Note:
Style must be CBS_DROPDOWN.

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).

Since:
1.1.8.
See also:
CueBanner.
Note:
Style must be CBS_DROPDOWN.
Example (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 = 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()

Result:

ComboBox_CueBanner.jpg

VARIANT_BOOL RW CueBannerAlwaysVisible

If specified true then the cue banner (specified by CueBanner) will be visible even when the control has focus.

Minimum OS: Windows XP. Requires visual styles (Themes).

Since:
1.1.8.
Note:
Style must be CBS_DROPDOWN.

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()

Result:

ComboBox_DropDownCount.jpg

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.

Since:
1.1.9.

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:

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 = 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()

Result:

ComboBox.jpg

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()

Result:

ComboBox_DropDownList.jpg

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()

Result:

ComboBox_Simple.jpg


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:23 2015. (C) Veretennikov A. B. 2004-2015