4de游乐场吧 关注:80贴子:2,317
  • 14回复贴,共1

电脑程序制作~~VB

只看楼主收藏回复

2元1次
Private Sub Command1_Click()
Dim a, b, c As Integer
Dim x1, x2 As Single
a = Val(InputBox("a=", "输入二次项系数"))
b = Val(InputBox("b=", "输入一次项系数"))
c = Val(InputBox("b=", "输入常数项"))
delta = b * b - 4 * a * c
If delta < 0 Then
Print "次方程无实根"
Else
x1 = (-b + Sqr(delta)) / (2 * a)
x2 = (-b - Sqr(delta)) / (2 * a)
Print "x1="; x1
Print "x2="; x2
End If
End Sub
Private Sub Command2_Click()
Cls
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
End Sub



IP属地:北京1楼2009-04-15 14:00回复
    Private Sub hsbred_Change()
    Picpreview.BackColor = RGB(hsbred.Value, hsbgreen.Value, hsbblue.Value)
    Txtred.Text = hsbred.Value
    End Sub
    Private Sub Txtblue_Change()
    If Txtblue.Text < 0 Or Txtblue.Text > 255 Then
    MsgBox ("数值超出范围,请重新输入。")
    Else
    hsbblue.Value = Txtblue.Text
    End If
    End Sub
    Private Sub Txtgreen_Change()
    If Txtgreen.Text < 0 Or Txtgreen.Text > 255 Then
    MsgBox ("数值超出范围,请重新输入。")
    Else
    hsbgreen.Value = Txtgreen.Text
    End If
    End Sub
    Private Sub Txtred_Change()
    If Txtred.Text < 0 Or Txtred.Text > 255 Then
    MsgBox ("数值超出范围,请重新输入。")
    Else
    hsbred.Value = Txtred.Text
    End If
    End Sub


    IP属地:北京2楼2009-04-15 14:01
    回复
      欢迎Vb加入
      Private Sub Command1_Click()
      End
      End Sub
      Private Sub Command2_Click()
      Label1.Caption = Text1.Text + "欢迎你加入VB的行列"
      End Sub
      Private Sub Command3_Click()
      Text1.Text = ""
      End Sub
      Private Sub Form_Load()
      End Sub


      IP属地:北京3楼2009-04-15 14:01
      回复
        鸡兔
        Private Sub Command1_Click()
        Dim a, b As Single
        a = Val(InputBox("a=", "输入头数"))
        b = Val(InputBox("a=", "输入脚数"))
        x = 2 * a - b / 2
        y = b / 2 - a
        Print "鸡数x="; x, "兔数y="; y
        End Sub
        Private Sub Command2_Click()
        Cls
        End Sub
        Private Sub Command3_Click()
        End
        End Sub
        Private Sub Form_Load()
        End Sub


        IP属地:北京4楼2009-04-15 14:02
        回复
          计算器
          Private Sub Command2_Click()
          Text1.Text = ""
          Text3.Text = ""
          Text2.Text = ""
          End Sub
          Private Sub Command3_Click()
          End
          End Sub
          Private Sub Command4_Click()
          Label1.Caption = "+"
          End Sub
          Private Sub Command5_Click()
          Label1.Caption = "-"
          End Sub
          Private Sub Command6_Click()
          Label1.Caption = "*"
          End Sub
          Private Sub Command7_Click()
          Label1.Caption = "/"
          End Sub
          Private Sub Form_Load()
          End Sub


          IP属地:北京5楼2009-04-15 14:02
          回复
            人民币转换
            Private Sub Command1_Click()
            Text2.Text = Text1.Text / 8
            End Sub
            Private Sub Command2_Click()
             Text1.Text = " "
             Text2.Text = " "
            End Sub
            Private Sub Command3_Click()
            End
            End Sub
            Private Sub Command4_Click()
            Text1.Text = Text2.Text / 0.125
            End Sub
            Private Sub Form_Load()
            End Sub
            Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
            Text1.Text = Text2.Text
            End Sub


            IP属地:北京6楼2009-04-15 14:02
            回复
              西瓜
              Private Sub Command1_Click()
              If Text1.Text <= 5 Then
               Label3.Caption = 3.5 * Text1.Text
              End If
              If Text1.Text > 5 And Text1.Text <= 10 Then
               Label3.Caption = 3.25 * Text1.Text
              End If
              If Text1.Text > 10 And Text1.Text <= 20 Then
               Label3.Caption = 3.1 * Text1.Text
              End If
              If Text1.Text > 20 Then
               Label3.Caption = 2.85 * Text1.Text
              End If
              End Sub
              Private Sub Command2_Click()
              Text1.Text = " "
               Label3.Caption = " "
              End Sub
              Private Sub Command3_Click()
              End
              End Sub


              IP属地:北京7楼2009-04-15 14:02
              回复
                Private Sub Form_Load()
                End Sub
                最大值
                Private Sub Command1_Click()
                Dim a, b, c As Single
                a = Val(InputBox("a=", "输入a的值"))
                b = Val(InputBox("b=", "输入b的值"))
                c = Val(InputBox("c=", "输入c的值"))
                Max = a
                If b > Max Then
                Max = b
                End If
                If c > Max Then
                Max = c
                End If
                Print Max
                End Sub
                Private Sub Command2_Click()
                Cls
                End Sub
                Private Sub Command3_Click()
                End
                End Sub
                Private Sub Form_Load()
                End Sub


                IP属地:北京8楼2009-04-15 14:03
                回复
                  调色板
                  Private Sub Form_Load()
                  hsbred.Value = 0
                  hsbgreen.Value = 0
                  hsbblue.Value = 0
                  Picpreview.BackColor = RGB(0, 0, 0)
                  End Sub
                  Private Sub hsbblue_Change()
                  Picpreview.BackColor = RGB(hsbblue.Value, hsbred.Value, hsbgreen.Value)
                  Txtblue.Text = hsbblue.Value
                  End Sub
                  Private Sub hsbgreen_Change()
                  Picpreview.BackColor = RGB(hsbgreen.Value, hsbred.Value, hsbblue.Value)
                  Txtgreen.Text = hsbgreen.Value
                  End Sub


                  IP属地:北京9楼2009-04-15 14:12
                  回复
                    哦哇!哦哇!
                    你是大好人耶!!!


                    IP属地:北京10楼2009-04-15 21:18
                    回复
                      • 211.146.12.*
                      这是什么?你们学这个?wangshuiyao


                      12楼2009-04-28 19:28
                      回复
                        • 221.223.65.*
                        对阿,会考就靠这个~~(刘溪霖)


                        13楼2009-05-05 21:27
                        回复
                          • 211.146.12.*
                          OMG!看上去好难呀!wsy


                          14楼2009-05-06 20:46
                          回复
                            ~~


                            IP属地:北京15楼2009-05-09 23:04
                            回复