20 Object Library Vb6: Microsoft Forms
Microsoft's official solution is clear: . If you must use the library, the only supported way to deploy your application is to restrict it to target machines that already have a licensed copy of Microsoft Office 97 or later installed. You would then need to document Microsoft Office as a prerequisite for your software.
This library is often used in VB6 specifically to gain access to Unicode-aware
' Clean up objects Set cmdButton = Nothing Set newForm = Nothing
A suite of new control icons will appear in your VB6 toolbox, including MSForms.TextBox , MSForms.ComboBox , MSForms.ListBox , MSForms.CommandButton , and more. 3. Key Technical Differences & Code Examples microsoft forms 20 object library vb6
Unlike standard VB6 forms, the Forms 2.0 library allows you to create a fully functional form with controls entirely through code. The following example demonstrates this by creating a new form, adding a button to it, displaying it, and cleaning up afterwards.
This code snippet demonstrates how to leverage the Controls collection to interact with all MSForms controls on a form. Similar techniques can be used for other controls.
For advanced standard tabs, lists, and trees. Microsoft's official solution is clear:
Add the following code:
: On Windows 10/11, FM20.dll behaves mostly fine, but high-DPI scaling and certain theming can cause visual glitches.
Instead of using the Forms 2.0 library, follow these steps to use the native Data Report Designer : : Go to the Project menu and select Add Data Environment . This library is often used in VB6 specifically
For instance, the Forms 2.0 TextBox supports better formatting options.
Here's an example of creating a simple form with a button and text box using the Microsoft Forms 2.0 Object Library:
' Add a checkbox to the new page Dim chk As MSForms.CheckBox Set chk = MultiPage1.Pages("Page2").Controls.Add("MSForms.CheckBox.1", "chkEnableLogging", True) chk.Caption = "Enable Logging" chk.Left = 10 chk.Top = 10
However, for internal enterprise applications where Microsoft Office is already deployed, the Microsoft Forms 2.0 library remains an excellent, zero-cost solution.