If universal deployment is mandatory, consider replacing Forms 2.0 controls with Krool's Common Controls (VBCCR) or other open-source, Unicode-aware VB6 control sets that are fully redistributable. 5. Troubleshooting Common Errors
A new set of distinct control icons will appear in your VB6 Toolbox, ready to be dragged and dropped onto your forms. Step-by-Step Implementation Examples
The library introduces alternatives to standard Win32 controls, offering enhanced visual and functional properties.
Option Explicit
Click , Change , BeforeDragOver , BeforeDropOrPaste . microsoft forms 20 object library vb6
The Microsoft Forms 2.0 Object Library is not a monolithic block; it is composed of several distinct controls and supporting objects, each designed for specific UI tasks. Here is a breakdown of the most commonly used components available in the library.
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:
Native VB6 controls are strictly ANSI-based. If you pass a Unicode string (e.g., Cyrillic, Chinese, or Arabic characters) to a standard VB6 TextBox , it displays as question marks ( ??? ). FM20 controls are natively Unicode-compliant, allowing proper text rendering for internationalization.
In this example, we create a new instance of the Form1 form, then set its caption, width, and height properties. We then add a command button to the form using the Controls.Add method, and set its caption, left, and top properties. Finally, we show the form using the Show method. Here is a breakdown of the most commonly
' Stretch to fit container Image1.PictureSizeMode = fmPictureSizeModeStretch
If your application must run on machines without Microsoft Office, avoid FM20.DLL . Instead, look into these alternatives:
If you are currently debugging or planning a project around this component, tell me:
Weaknesses
' Form Load Event Private Sub Form_Load() ' Adding items to a Forms 2.0 ComboBox With ComboBox1 .AddItem "Option 1" .AddItem "Option 2" .AddItem "Option 3" .ListIndex = 0 ' Set default selection End With End Sub ' Example of reading the value Private Sub Command1_Click() MsgBox "Selected: " & ComboBox1.Text End Sub Use code with caution. Alternatives to Microsoft Forms 2.0
Always set Picture property via LoadPicture for BMP/DIB/JPG. For icons, use LoadResPicture with resource files.
' Assume you have "Microsoft Forms 2.0 Object Library" referenced ' and a control named "MultiPage1" on your form.