vb代码语句问题求解,在线等。
一个定时提醒小程序:一个主窗口Form1,2个对话框Dialog,Dialog1要求先弹出Dialog,按下是以后再弹出Dialog1!可是弹出第一个Dialog后,按是...
一个定时提醒小程序:
一个主窗口Form1,2个对话框 Dialog, Dialog1
要求先弹出Dialog,按下是以后再弹出Dialog1!可是弹出第一个Dialog后,按是到时间后却不弹出Dialog1!
代码如下:
Private Sub Timer1_Timer()
If Val(Text1) = Hour(Now) And Val(Text2) - 1 = Minute(Now) Then
Dialog.Show 1
If VBOK = "ok" Then
Timer1.Enabled = False
End If
If Val(Text1) = Hour(Now) And Val(Text2) = Minute(Now) Then
Dialog1.Show 1
End If
End If
End Sub
第一个对话框Dialog:
Option Explicit
Private Sub CancelButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.VBOK = "ok"
End Sub
Private Sub CancelButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Hide
Form1.Timer1.Enabled = False
End Sub
Private Sub OKButton_Click()
Me.Hide
End Sub
能帮解决的另加分! 展开
一个主窗口Form1,2个对话框 Dialog, Dialog1
要求先弹出Dialog,按下是以后再弹出Dialog1!可是弹出第一个Dialog后,按是到时间后却不弹出Dialog1!
代码如下:
Private Sub Timer1_Timer()
If Val(Text1) = Hour(Now) And Val(Text2) - 1 = Minute(Now) Then
Dialog.Show 1
If VBOK = "ok" Then
Timer1.Enabled = False
End If
If Val(Text1) = Hour(Now) And Val(Text2) = Minute(Now) Then
Dialog1.Show 1
End If
End If
End Sub
第一个对话框Dialog:
Option Explicit
Private Sub CancelButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.VBOK = "ok"
End Sub
Private Sub CancelButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Hide
Form1.Timer1.Enabled = False
End Sub
Private Sub OKButton_Click()
Me.Hide
End Sub
能帮解决的另加分! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询