1.选中部分的长度。 Text2 = Text1.SelLength
2.text1中的字母变成小写,text2中的字母变成大写.
Text1.Text = LCase(Text1.Text)
Text2.Text = UCase(Text1.Text)
3.在文本框中显示。 If Option1 Then
Text1 = List1.Text & Option1.Caption
Else
Text1 = List1.Text + Option2.Caption
End If
4.单击交换图片。 P1.Picture = LoadPicture("pic2.jpg")
P2.Picture = LoadPicture("pic1.bmp")
5.通过复选框选课.Private Sub C1_Click()
Dim s1 As String
s1 = "我选的课是"
If Ch1.Value = 1 And Ch2.Value = 0 Then
Text1 = s1 & Ch1.Caption
ElseIf Ch1.Value = 0 And Ch2.Value = 1 Then
Text1 = s1 & Ch2.Caption
Else
Text1 = s1 & Ch1.Caption & Ch2.Caption
End If
End Sub
6.Array?
7.选择组合框中的一个项目,计算正余弦值。
If Combo1.ListIndex = 0 Then
Text2 = Fix(Sin(Val(Text1) / 180 * 3.14159) * 1000) / 1000 ElseIf Combo1.ListIndex = 1 Then
Text2 = Fix(Cos(Val(Text1) / 180 * 3.14159) * 1000) / 1000 End If
8.通过右击打开菜单。 If Button = 2 Then
Me.PopupMenu Format
End If
9.单击载入图片。Image1.Picture = LoadPicture(App.Path & "\MISC34.ico")
10.单击清除。Set Image1.Picture = Nothing
11.运行滚动条。HScroll1.SetFocus
12.显示滚动条所在位置。Text1.Text = HScroll1.Value
13.滚动条右移。HS1.Value = HS1.Value + 10
14.标签显示当前时间或日期。Label1 = Date Label1 = Time
15.设置背景为红色。Form1.BackColor = &HFF&
16.单击窗体显示对话框。InputBox "请输入", "等级考试", "Basic"