VB程序代码精品管理.docVIP

  • 9
  • 0
  • 约3.33万字
  • 约 36页
  • 2021-08-25 发布于湖北
  • 举报
2-4 Private Sub Command1_Click() Text1.Font = 黑体 Text2.Font = 隶书 End Sub Private Sub Command2_Click() Text1.ForeColor = vbRed Text2.BackColor = vbBlue End Sub Private Sub Command3_Click() End End Sub 2-5 Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) form1.BackColor = vbGreen End Sub Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) form1.BackColor = vbRed End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Text1.Text = 在窗体上抬起了鼠标 End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Text1.Text = 在窗体上anxia了鼠标 End Sub 2-6 Private Sub Command1_Click() Form1.Print hhggg End Sub Private Sub Command2_Click() Form1.Cls End Sub 2-8 Private Sub Command1_Click() Text1.Text = Text2.Text = Text3.Text = Text1.SetFocus Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End Sub Private Sub Command2_Click() End End Sub Private Sub Text1_Change() Text2.Text = Text1.Text Text3.Text = Text1.Text End Sub 2-10 Dim x As Single Private Sub Command1_Click() x = x + 5 Text1.FontSize = x End Sub Private Sub Command2_Click() If x 10 Then Text1.FontSize = 5 ElseIf x = 10 Then x = x - 5 Text1.FontSize = x End If End Sub Private Sub Command3_Click() Text1.FontUnderline = True End Sub Private Sub Command4_Click() Text1.FontStrikethru = True End Sub Private Sub Command5_Click() Text1.FontBold = True End Sub Private Sub Command6_Click() Text1.FontItalic = True End Sub 3-1 代码如下 Const pi = 3.14 Dim r As Single, h As Single Private Sub Command1_Click() r = Val(Text1.Text) h = Val(Text2.Text) Text3.Text = Val(pi * r ^ 2) Text4.Text = Val(2 * pi * r * h) Text5.Text = Val(pi * r ^ 2 * h) End Sub Private Sub Command1_Click() 代码如下 Private Sub Command1_Click() randomize Text1.Text = Int(100 * Rnd + 1) Text2.Text = Int(100 * Rnd + 1) End Sub Private Sub Com

文档评论(0)

1亿VIP精品文档

相关文档