输入中奖号码,查询是否中奖的按纽事件代码:代码如下:
Option Explicit
Private Sub cmdCheck_Click()
     Dim strInput As String
     strInput = txtInput.Text
     If strInput = "123" Then
        lab1.Caption = "恭喜"
     End IfEnd Sub

解决方案 »

  1.   

    看看控件名有没有写对?
    txtInput  、 lab1
      

  2.   

    看看控件名有没有写对?
    txtInput  、 lab1
      

  3.   

    你新建个工程,添加一个command,一个label,一个text,不用改名字,把下面代码直接贴进去就行。
    Private Sub Command1_Click()
    Dim strInput As String
         strInput = Text1.Text
         If strInput = "123" Then
            Label1.Caption = "恭喜"
         End If
    End Sub
      

  4.   

    你新建个工程,添加一个command,一个label,一个text,不用改名字,把下面代码直接贴进去就行。
      

  5.   

    Private Sub Command1_Click()
    Dim strInput As String
         strInput = Text1.Text
         If strInput = "123" Then
            Label1.Caption = "恭喜"
         End If
    End Sub