我不知道为什么该程序无法实现鼠标单击窗体后记事本有计数功能,请高手帮帮忙
Private Sub Form1_Load()
Text1 = 0
End Sub
Private Sub Form1_Click()
Text1 = Val(Text1) + 1
End Sub
     还有这个程序是哪里出错了为什么要点击窗体的放大缩小图标子才会移动Dim step As Integer
Private Sub Form1_Load()
step = 1
Label1.Caption = "我开始学习程序设计"
Timer1.Interval = 0
End Sub
Private Sub Timer1_Timer()
Call MyMove
End Sub
Private Sub Command1_Click()
Timer1.Interval = 200
Call MyMove                          '自动
End Sub
Private Sub Command2_Click()         '手动
Timer1.Interval = 0
Call MyMove
End Sub
Public Sub MyMove()
Label1.Move Label1.Left + 500 * step
If Label1.Left + Label1.Width > Form1.Width Then
   step = -1
 ElseIf Label1.Left < 0 Then
   step = 1
 End If
End Sub

解决方案 »

  1.   

    要用form 不是form1'我不知道为什么该程序无法实现鼠标单击窗体后记事本有计数功能,请高手帮帮忙 
    Private Sub Form_Load() 
        Text1 = 0 
    End Sub Private Sub Form_Click() 
        Text1 = Val(Text1) + 1 
    End Sub 
      

  2.   

    一样的问题,form1改成form'    还有这个程序是哪里出错了为什么要点击窗体的放大缩小图标子才会移动Dim step As IntegerPrivate Sub Form_Load()
        step = 1
        Label1.Caption = "我开始学习程序设计"
        Timer1.Interval = 0
    End SubPrivate Sub Timer1_Timer()
        Call MyMove
    End SubPrivate Sub Command1_Click()
        Timer1.Interval = 200
        Call MyMove                          '自动
    End SubPrivate Sub Command2_Click()        '手动
        Timer1.Interval = 0
        Call MyMove
    End SubPublic Sub MyMove()
        Label1.Move Label1.Left + 500 * step
        
        If Label1.Left + Label1.Width > Form1.Width Then
            step = -1
        ElseIf Label1.Left < 0 Then
            step = 1
        End If
    End Sub
      

  3.   

    哥们儿,这个可以实现Private Sub Form_Click()
        Static a As Integer
        a = a + 1
        Text1.Text = a
    End Sub
      

  4.   


    Dim step As IntegerPrivate Sub Form_Load()
        step = 1
        Label1.Caption = "我开始学习程序设计"
        Timer1.Interval = 50    '哥们,为什么不动,是因为你这个时间没设置,他怎么动,你只要把你的0改掉它就会走了
    End SubPrivate Sub Timer1_Timer()
        Call MyMove
    End SubPrivate Sub Command1_Click()
        Timer1.Interval = 200
        Call MyMove                          '自动
    End SubPrivate Sub Command2_Click()        '手动
        Timer1.Interval = 0
        Call MyMove
    End SubPublic Sub MyMove()
        Label1.Move Label1.Left + 500 * step
        
        If Label1.Left + Label1.Width > Form1.Width Then
            step = -1
        ElseIf Label1.Left < 0 Then
            step = 1
        End If
    End Sub
      

  5.   


    Timer1.Interval=0 没有问题,他是因为把form写成form1,导致的错误