'This project needs a button
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Me.Caption = "Your system will sleep 5 sec."
'Sleep for 5000 milliseconds
Sleep 5000
Me.Caption = ""
End Sub
Private Sub Form_Load()
Me.Caption = ""
Command1.Caption = "Sleep ..."
End Sub
Adolf писал(а):Активация
Действие 1
Ждать (допустим 10 секунд) (?)
Действие 2
Александр80 писал(а):Adolf писал(а):Активация
Действие 1
Ждать (допустим 10 секунд) (?)
Действие 2
Что-то не доброе затеял...
Private Sub cmd..._Click()
If lbl1.Caption = "..." Then
lbl2.Caption = "..."
Далее проходит 10 секунд <-Как описать данное действие.
lbl2.Caption = "..."
...
Private Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
Private Sub cmd..._Click()
Dim Time1 As Long, Time2 As Long
If lbl1.Caption = "..." Then
lbl2.Caption = "..."
Time1 = GetTickCount
Time2 = Time1
Do While Time2 - Time1 < 10000
Time2 = GetTickCount
DoEvents
Loop
lbl2.Caption = "..."
...
Private Sub cmd..._Click()
Dim T!
If lbl1.Caption = "..." Then
lbl2.Caption = "..."
T = Timer
Do Until Timer - T >= 10000
Me.Caption = 10 - Int(Timer - T)
DoEvents
Loop
lbl2.Caption = "..."
Private Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
Private Sub cmd..._Click()
Dim Time1 As Long, Time2 As Long
If lbl1.Caption = "..." Then
lbl2.Caption = "..."
Time1 = GetTickCount
Time2 = Time1
Do While Time2 - Time1 < 10000
Time2 = GetTickCount
DoEvents
Loop
If ActionsDone Then
lbl2.Caption = "..."
...
End If
Do While Time2 - Time1 < 10000
Time2 = GetTickCount
DoEvents
Loop
If <условие1> Or <условие2> Or ... Or <условиеN> Then Exit Sub
Private Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
Private Sub Form_Load()
Dim Time1 As Long, Time2 As Long
Time1 = GetTickCount
'... действия
'... действия
'... действия
Time2 = GetTickCount
MsgBox "Действия продолжались " & (Time2 - Time1) / 1000 & " с."
End Sub
Сейчас этот форум просматривают: AhrefsBot, Google-бот и гости: 71