Microsoft Forms 20 Object Library Vb6 [2021] May 2026

A blast from the past!

Microsoft Forms 2.0 Object Library (also known as FM20.dll) is a legacy library used in Visual Basic 6 (VB6) for creating graphical user interfaces (GUIs) and forms. Here's some content related to it:

Overview

The Microsoft Forms 2.0 Object Library is a COM (Component Object Model) library that provides a set of objects, properties, and methods for creating forms, controls, and other GUI elements in VB6. It was introduced in Visual Basic 6.0 and is still supported in later versions of VB6.

Key Features

The Microsoft Forms 2.0 Object Library provides the following key features: microsoft forms 20 object library vb6

  1. Form objects: Create and manipulate forms, including setting properties like caption, size, and position.
  2. Control objects: Add and manage controls like buttons, text boxes, list boxes, and more to your forms.
  3. Event-driven programming: Respond to user interactions and events, such as button clicks and key presses.
  4. Property pages: Customize control properties using property pages.

Commonly Used Objects and Controls

Some commonly used objects and controls in the Microsoft Forms 2.0 Object Library include:

  1. Form: The base object for creating forms.
  2. CommandButton: A standard push button.
  3. TextBox: A single-line or multi-line text box.
  4. ListBox: A list box control for displaying and selecting items.
  5. ComboBox: A combo box control for selecting items from a list.

Example VB6 Code

Here's an example of creating a simple form with a button and text box using the Microsoft Forms 2.0 Object Library:

Dim frm As New Form1
Dim btn As CommandButton
Dim txt As TextBox
' Create a new form
frm.Caption = "My Form"
frm.Width = 300
frm.Height = 200
' Create a button
Set btn = frm.Controls.Add("FM20.CommandButton")
btn.Caption = "Click Me"
btn.Left = 10
btn.Top = 10
' Create a text box
Set txt = frm.Controls.Add("FM20.TextBox")
txt.Text = "Enter some text"
txt.Left = 10
txt.Top = 40
' Show the form
frm.Show

References and Troubleshooting

To use the Microsoft Forms 2.0 Object Library in your VB6 project:

  1. Open the Visual Basic Editor and select "References" from the "Tools" menu.
  2. Check the box next to "Microsoft Forms 2.0 Object Library" (or browse to the location of FM20.dll).

Common issues and troubleshooting:

Keep in mind that the Microsoft Forms 2.0 Object Library is a legacy technology, and Microsoft has moved on to newer technologies like Windows Forms, WPF, and Universal Windows Platform (UWP) for developing GUI applications. If you're starting a new project, consider using a more modern framework.


What is the Microsoft Forms 2.0 Object Library?

Despite its name, the Microsoft Forms 2.0 Object Library (FM20.dll) is not exclusively for Microsoft Excel or Word user forms. It is a standalone library of user interface controls that originally shipped with Microsoft Office. However, VB6 developers can reference and use these controls in their native applications.

The library provides a set of sophisticated controls that are more polished and feature-rich than some of VB6’s original intrinsic controls. A blast from the past

Error 3: The library disappears from Components list after adding

Cause: VB6 sometimes loses references if the project path changes or if Office was updated. Solution: Save your project before adding the reference. Use binary compatibility carefully. Hardcode the reference GUID if needed.

Why Use the Forms 2.0 Library in VB6?

You might wonder: "Why should I use FM20 controls when VB6 has its own native controls (Textbox, CommandButton, ListBox, etc.)?" The answer lies in features:

  1. Multi-Column ListBox/ComboBox: The native VB6 ListBox is single-column. Forms 2.0 ListBox supports multiple columns, bound column selection, and column widths.
  2. Better Graphics Support: FM20 controls support Picture properties with transparent backgrounds, mouse icons, and alignment options.
  3. Uniform Object Model: All FM20 controls share common properties: BackColor, ForeColor, Font, Picture, MousePointer, ControlTipText, etc.
  4. Advanced Events: Events like BeforeDragOver, BeforeDropOrPaste, Scroll, Zoom (for Image control).
  5. Modern UI Feel (for its era): The library supports hot tracking, flat styles, and 3D effects.

Limitations

Should You Use It in 2024+?

Yes, if:

No, if:

4. The SpinButton and ScrollBar

Useful for numeric increments without a separate textbox. Form objects : Create and manipulate forms, including

Private Sub SpinButton1_SpinUp()
    TextBox1.Text = Val(TextBox1.Text) + 1
End Sub

Private Sub SpinButton1_SpinDown() TextBox1.Text = Val(TextBox1.Text) - 1 End Sub

Using fm20.dll in Standalone Applications

The Pros and Cons