正在加载图片...
xt1.Text="星期二( Tuesday)" C Text1.Text="星期三( Wednesday)" Text1.Text="星期四( Thursday) Text1.Text="星期五( Friday)" Text1.Text="星期六( Saturday) Case else TextI.Text="输入错误 End select End sub 3.窗体上建立了一个文本框Text(“输入口令”)和一个命令按钮 Command1(“检查”) Private Sub Command l Click o “检查” Ifx="12345678″Then MsgBox("欢迎你用机!") Else MsgBox("对不起,口令错") End If TextI Text TextI Set Focus End sub Private Sub Form Load TextI Text Textl. MaxLength =8 Text. P End sub 4.窗体上建立了两个文本框 Text(输入字符串)及Text2(转换结果),一个命令按钮 Commandl(“清 Private Sub Commandl Click O “清除” TextI Set Focus End sub Private Sub Textl KeyPress(KeyAscii As Integer) s= Chr(KeyAscii Select case s s= UCase(s) Case el End Select Text2. Text Text2 Text +s End sub 5.分别选择”红”、”绿”、”蓝”复选框后,单击命令按钮 Command 1时,通过RGB函数调配的颜 色作为一个标签的背景色( Back Color) Private Sub Commandl Click If Check Value =1 The ”红”复选框 绿”复选框 =255 End if5 Case Is = 2 Text1.Text = "星期二(Tuesday)" Case Is = 3 Text1.Text = "星期三(Wednesday)" Case Is = 4 Text1.Text = "星期四(Thursday)" Case Is = 5 Text1.Text = "星期五(Friday)" Case Is = 6 Text1.Text = "星期六(Saturday)" Case Else Text1.Text = "输入错误" End Select End Sub 3.窗体上建立了一个文本框 Text1(“输入口令”)和一个命令按钮 Command1(“检查”)。 Private Sub Command1_Click() '“检查” x = Text1.Text If x = "12345678" Then MsgBox ("欢迎你用机!") Else MsgBox ("对不起,口令错") End If Text1.Text = "" Text1.SetFocus End Sub Private Sub Form_Load() Text1.Text = "" Text1.MaxLength = 8 Text1.PasswordChar = "*" End Sub 4.窗体上建立了两个文本框 Text1(输入字符串)及 Text2(转换结果),一个命令按钮 Command1(“清 除”)。 Private Sub Command1_Click() '“清除” Text1.Text = "" Text2.Text = "" Text1.SetFocus End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) Dim s As String * 1 s = Chr(KeyAscii) Select Case s Case "A" To "Z" s = LCase(s) Case "a" To "z" s = UCase(s) Case Else s = "*" End Select Text2.Text = Text2.Text + s End Sub 5. 分别选择”红”、 ”绿”、 ”蓝”复选框后,单击命令按钮 Command1 时,通过 RGB 函数调配的颜 色作为一个标签的背景色(BackColor)。 Private Sub Command1_Click() r = 0: g = 0: b = 0 If Check1.Value = 1 Then '”红”复选框 r = 255 End If If Check2.Value = 1 Then '”绿”复选框 g = 255 End If
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有