How can I insert and configure an MSForms Multipage object in a project?
Solution:
To add the object, go to E3Studio, right-click the screen and select the Insert-MSForms-Multipage option.
To set it up, you must use scripts, because it can only be set in runtime. Below is an example of VBScript’s settings, which should be executed in Multipage‘s OnStartRunning event:
Sub MultiPage1_OnStartRunning()
Set MultiPage = Screen.Item(“MultiPage1”)
‘Changes the name of the page
‘Page(0) = First page
MultiPage.Pages(0).Caption = “Screen 1”
‘Page(1) = Second page
MultiPage.Pages(1).Caption = “Screen 2”
‘Adds new page
MultiPage.Pages.Add
‘Changes the name of the inserted new page
MultiPage.Pages(2).Caption = “Screen 3”
‘Adds item in the first page
Set MyTextBox = MultiPage.Pages(0).Controls.Add(“Forms.ComboBox.1”)
‘Adds a list in the ComboBox object
MyTextBox.AddItem “Screen 1”
MyTextBox.AddItem “Screen 2”
MyTextBox.AddItem “Screen 3”
‘Adds item in the second page
Set MyComboBox = MultiPage.Pages(1).Controls.Add(“Forms.ComboBox.1”)
‘Adds a list in the ComboBox object
MyComboBox.AddItem “Item A”
MyComboBox.AddItem “Item B”
MyComboBox.AddItem “Item C”
MyComboBox.AddItem “Item D”
End Sub
NOTE: For further information, please refer toVBScript’s Reference Manual, which is installed alongside E3’s documentation.