| Control | ProgID | Key props/methods | |---|---:|---| | TextBox | Forms.TextBox.1 | .Text, .SelStart, .SelLength | | Label | Forms.Label.1 | .Caption | | CommandButton | Forms.CommandButton.1 | .Caption, Click | | ListBox | Forms.ListBox.1 | .AddItem, .ListIndex, .List | | ComboBox | Forms.ComboBox.1 | .AddItem, .Style, .ListIndex | | CheckBox | Forms.CheckBox.1 | .Value | | OptionButton | Forms.OptionButton.1 | .Value | | Image | Forms.Image.1 | .Picture | | RefEdit | Forms.RefEdit.1 | .Text |
| Issue | Description |
|-------|-------------|
| No design-time visual designer | You cannot drop MSForms controls onto a VB6 Form designer. They must be added via code. |
| Licensing (FM20.DLL) | The library is licensed by Microsoft Office. On a machine without Office installed, FM20.DLL may be missing or fail to register, causing runtime errors. |
| Redistribution | You generally cannot redistribute FM20.DLL with your VB6 app. It must be present as part of Office or a legally licensed host. |
| Property differences | Properties like Font, ForeColor, and BackColor behave differently from VB6 intrinsic controls. |
| No native data binding | Unlike VB6 controls, MSForms controls do not directly support the VB6 DataControl binding model. |
| Control | Description | |---------|-------------| | CheckBox | Multiple selection option | | ComboBox | Drop-down list with text entry | | CommandButton | Clickable button | | Frame | Container for other controls | | Image | Picture display | | Label | Static text | | ListBox | Selectable list | | MultiPage | Tabbed interface | | OptionButton | Single selection (radio button) | | ScrollBar | Scrolling control | | SpinButton | Increment/decrement control | | TabStrip | Tab navigation | | TextBox | Text input/output | | ToggleButton | Two-state button | microsoft forms 20 object library vb6
Private Sub SpinButton1_SpinDown() If IsNumeric(TextBox1.Text) Then TextBox1.Text = Val(TextBox1.Text) - 1 End If End Sub
Private Sub SpinButton1_SpinUp() If IsNumeric(TextBox1.Text) Then TextBox1.Text = Val(TextBox1.Text) + 1 End If End Sub
When distributing your VB6 application:
The MultiPage control is a container that hosts multiple pages, each acting as a separate form area. It’s perfect for property sheets and wizards. | Control | ProgID | Key props/methods |
' Add a page at runtime MultiPage1.Pages.Add "NewPage", "Page 2", 1' Remove first page MultiPage1.Pages.Remove 0
' Change selected page index MultiPage1.Value = 1 ' Second pagemicrosoft forms 20 object library vb6
Events: Click, Change, BeforeDragOver, BeforeDropOrPaste.