Article ID: 180822
Article Last Modified on 8/27/2007
236458 Using Microsoft Forms 2.0 in Internet Explorer
Sub CommandButton1_Click()
' Displays a message box with the date when the command
' button is clicked.
msgbox "Today's date is " &DATE,64,"My MsgBox"
End sub
Sub CommandButton2_Click()
' The following example fills a Label control with text
' when you click the command button.
Label1.Caption="Today's date is " & DATE
End sub
Sub CommandButton3_Click()
' Text box will be filled in when you click the command
' button.
TextBox2.Text="You have entered: "& UCASE(TextBox1.Text)
End sub
sub CommandButton4_Click()
' Evaluates the value of the check box and inserts text
' in the label when you click the command button.
if CheckBox1.Value=TRUE then Label2.Caption="The checkbox _
is checked"
if CheckBox1.Value=FALSE then Label2.Caption="The checkbox _
is not checked"
end sub
Sub CommandButton5_Click()
' Evaluates the value of the option button and inserts
' text in the label when you click the command button.
If OptionButton1.Value=True Then
Label3.Caption = "This option is selected"
Else
Label3.Caption = "The other option is selected"
End If
End sub
sub ToggleButton1_Click()
' Evaluates the value of the toggle button and inserts text
' in the label when you click the command button.
If ToggleButton1.Value = True Then
ToggleButton1.Caption = "DEPRESSED"
Else
ToggleButton1.Caption = ""
End If
End Sub
sub SpinButton1_SpinDown()
' Evaluates if the spin button has been clicked and
' inserts text in the label when you click the
' command button.
Label4.Caption = SpinButton1.Value
end sub
sub SpinButton1_SpinUp()
' Evaluates if the spin button has not been clicked
' and inserts text in the label when you click the
' command button.
Label4.Caption = SpinButton1.Value
end sub
Sub ScrollBar1_Change()
' Evaluates the position of the marker on the scroll bar and
' inserts text in the label when the command button is
' clicked.
Label5.Caption = -(ScrollBar1.Value)
End sub
Sub ListBox1_Click()
' Evaluates which option in a list box has been
' selected and fills in the resulting text in the label
' when the command button is clicked.
Label6.Caption= "You have selected " & _
Listbox1.List(ListBox1.ListIndex)
End sub
NOTE: A ListBox requires you to write script that populates the
list with values in an array. The script should be inserted at the
top of the page so that it executes when your page is opened in
a Web browser.
Sub window_onLoad()
' Creates and populates the array used in the preceding
' list box example.
'
' Dimension array to populate the list box.
Dim ListBoxArray(2)
ListBoxArray(0)="RED"
ListBoxArray(1)="WHITE"
ListBoxArray(2)="BLUE"
ListBox1.List=ListBoxArray
End sub
sub ComboBox1_Click()
' Evaluates which option in a combo box has been
' selected and fills in the resulting text in the label
' when the command button is clicked
Label7.Caption= "You have selected " & _
ComboBox1.List(ComboBox1.ListIndex)
end sub
' Creates and populates the array used in the
' preceding list box example.
'
' Dimension array to populate the list box.
Dim ComboBoxArray(2)
ComboBoxArray(0)="RED"
ComboBoxArray(1)="WHITE"
ComboBoxArray(2)="BLUE"
ComboBox1.List=ComboBoxArray
Additional query words: 98 activex ie fpscript
Keywords: kbinfo KB180822