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
Commonly Used Objects and Controls
Some commonly used objects and controls in the Microsoft Forms 2.0 Object Library include:
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:
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.
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
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.
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:
Picture properties with transparent backgrounds, mouse icons, and alignment options.BackColor, ForeColor, Font, Picture, MousePointer, ControlTipText, etc.BeforeDragOver, BeforeDropOrPaste, Scroll, Zoom (for Image control).Yes, if:
MultiPage or SpinButton.No, if:
vbWidgets or ActiveX Controls instead).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