This is arguably the most popular reason to use the library. The MultiPage control allows you to create tabbed dialog interfaces without using third-party controls.
Let's build a small example that demonstrates the power of the MSForms 2.0 library.
Step 1: Create a new Standard EXE project in VB6.
Step 2: Add the Microsoft Forms 2.0 Object Library via Components (Ctrl+T).
Step 3: Draw a MultiPage control on your VB6 form. Resize it to fit.
Step 4: Add a CommandButton named cmdOK and another named cmdCancel.
Step 5: Add the following code:
Private Sub Form_Load() ' Rename the MultiPage tabs MultiPage1.Pages(0).Caption = "General" MultiPage1.Pages(1).Caption = "Advanced"' Add a Forms 2.0 TextBox to the General tab dynamically Dim txtName As MSForms.TextBox Set txtName = MultiPage1.Pages(0).Controls.Add("Forms.TextBox.1", "txtUserName", True) txtName.Left = 10 txtName.Top = 10 txtName.Width = 150 txtName.Text = "Enter your name"End Sub
Private Sub cmdOK_Click() ' Access the dynamic control Dim userInput As String userInput = MultiPage1.Pages(0).Controls("txtUserName").Text MsgBox "Hello, " & userInput End Sub
This example shows how to both design-time and runtime-manipulate MSForms controls inside your VB6 project.
Overview
Strengths
Weaknesses
Technical notes for VB6 developers
Recommendations
Concise verdict
If you need to manipulate Forms 2.0 objects in code without placing them on a form (e.g., creating a dynamic dialog), you should add a reference:
After adding the reference, you can declare objects like:
Dim myForm As MSForms.UserForm
Dim myTextBox As MSForms.TextBox
The library is officially version 2.0, but developers often search for "Forms 20" (dropping the decimal) or "Microsoft Forms 2.0". The file version of FM20.dll can vary (e.g., 2.0.1.3, 2.0.5.3), but the object model remains consistent. When you see "Microsoft Forms 2.0 Object Library" in your VB6 References dialog, that is the correct entry. microsoft forms 20 object library vb6