Article ID: 171673
Article Last Modified on 11/22/2007
236458 Using Microsoft Forms 2.0 in Internet Explorer
Sub CommandButton1_Click()
' The Following line 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 the command button is clicked.
Label1.Caption="Today's date is " & DATE
End sub
Sub CommandButton3_Click()
' The following example fills in a text box
' when the command button is clicked
TextBox2.Text="You have entered: "& UCASE(TextBox1.Text)
End sub
sub CommandButton4_Click()
' This example evaluates the value of the checkbox and fills
' in text in the label when the command button is clicked
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()
' This example evaluates the value of the option button and
fills
' in text in the label when the command button is clicked
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()
' This example evaluates the value of the toggle button and
' fills in text in the label when the command button is
clicked.
If ToggleButton1.Value = True Then
ToggleButton1.Caption = "DEPRESSED"
Else
ToggleButton1.Caption = ""
End If
End Sub
sub SpinButton1_SpinDown()
' This example evaluates if the spin button has been depressed
and
' fills in text in the label when the command button is clicked
Label4.Caption = SpinButton1.Value
end sub
sub SpinButton1_SpinUp()
' This example evaluates if the spin button has not been
depressed
' and fills in text in the label when the command button is
clicked
Label4.Caption = SpinButton1.Value
end sub
Sub ScrollBar_Change()
' This example evaluates the position of the marker on the
scroll
' bar fills in text in the label when the command button is
clicked
Label5.Caption = -(ScrollBar1.Value)
End sub
Sub ListBox1_Click()
' This example 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 runs when your page is loaded into a Web
browser.
Sub window_onLoad()
' This example creates and populates the array used in the
' proceeding list box example
' dim array to populate ListBox
Dim ListBoxArray(2)
ListBoxArray(0)="RED"
ListBoxArray(1)="WHITE"
ListBoxArray(2)="BLUE"
ListBox1.List=ListBoxArray
End sub
sub ComboBox1_Click()
' This example 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
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 loaded into a Web
browser.
' This example creates and populates the array used in the
' combo box example.
'
' dimension array to populate ComboBox
Dim ListBoxArray(2)
ListBoxArray(0)="RED"
ListBoxArray(1)="WHITE"
ListBoxArray(2)="BLUE"
ListBox1.List=ListBoxArray
Additional query words: 97 98 fpscript
Keywords: kbcode kbhowto KB171673