ComboBox Ocx

Purpose

Creates an Ocx ComboBox control in the current active form, window, or dialog.

Syntax

Ocx ComboBox name [= text$] [, id] [, x, y, b, h] [, style%]

text$:control text
id%:control identifier
x, y, b, h:iexp
style%:the control styles

Description

The control is a rectangle containing a list of strings (such as filenames) from which the user can select.

The ComboBox Ocx control has the following properties, methods, and events.

Properties

Appearance | BackColor | ForeColor | BorderStyle | Columns | DisableNoScroll | Enabled | Font | FontBold | FontItalic | FontStrikethru | FontUnderline | FontName | FontSize | Height, Width | HelpContextID | hWnd | Index | IntegralHeight |ItemData | Left, Top | List | ListCount | ListIndex | MouseCursor | MouseIcon | MousePointer | Name | NewIndex | Parent | Scrollbars | Selected | Sorted | Style | TabStop | Tag | Text | ToolTiptext | TopIndex | Visible | WhatsThisHelpID

Methods

AddItem | Clear | Find | FindExact | FindNext | InsertItem | Move | Refresh | RemoveItem | SetFocus | SetFont | TextHeight | TextWidth | ZOrder

Events

Click | DblClick | GotFocus | LostFocus | KeyDown, KeyUp | KeyPress | MouseDown | MouseUp | MouseMove | Scroll

There is no event which covers every eventually of the selected item being changed as the Click event only occurs when an object in the dropdown list is selected by using the mouse or by the up and down arrow keys, which means that occurences of the selected item being changed by physically typing in the value are missed. In the absence of a dedicated Change event, you can embed a call to Click in the KeyUp event which will effectively make the Click take on this role.

Remarks

The ComboBox object lacks some of the functionality that can be found in VB6 and most other programming languages which use it as an object; this can be overcome by using the SendMessage() API as follows:

See Also

Ocx, OcxOcx

Animation, CheckBox, Command, CommDlg, Form, Frame, Image, ImageList, Label, ListBox, ListView, MonthView, Option, ProgressBar, RichEdit, Scroll, Slider, StatusBar, TabStrip, TextBox, Timer, TrayIcon, TreeView, UpDown

{Created by Sjouke Hamstra; Last updated: 08/03/2018 by James Gaite}