求滚动的屏保程序

解决方案 »

  1.   


    'Form1.frm code
    Option Explicit
    Private Sub Form_Click()
        End
    End SubPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        Dialog.Show
    End SubPrivate Sub Form_Load()
        Label1.Caption = Time$
        Timer2.Enabled = False
        Timer1.Enabled = True
        Timer1.Interval = 500
        Timer2.Interval = 500
    End SubPrivate Sub Timer1_Timer()
        If Label1.Left > 0 Then
            Label1.Left = Label1.Left - 500
        Else
            Timer1.Enabled = False
            Timer2.Enabled = True
        End If
    End SubPrivate Sub Timer2_Timer()
        If Label1.Left < Me.Width Then
            Label1.Left = Label1.Left + 500
        Else
            Timer2.Enabled = False
            Timer1.Enabled = True
        End If
    End Sub
    'Dialog.frm Code
    Option ExplicitPrivate Sub CancelButton_Click()
        Unload Dialog
    End SubPrivate Sub Form_Load()
        Text1 = Form1.Label1.Caption
    End SubPrivate Sub OKButton_Click()
        Form1.Label1.Caption = Text1
        Unload Dialog
    End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 And Text1 <> "" Then
            Form1.Label1.Caption = Text1
            Unload Dialog
        End If
    End Sub