求 VB 10秒倒计时代码

发布于2022-01-01 16:59:47
7个回答
admin
网友回答2022-01-01
Dim test As Long
Private Sub Form_Load()
Timer1.Interval = 1000
test = 10
Text1.Text =
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Text1.Text = test
test = test - 1
If Text = 0 Then
Timer1.Enabled = False
'到时间处理的事件
End If
End Sub
admin
网友回答2022-01-01
Option Explicit

Private Declare Function FindWindowEx Lib user32 Alias FindWindowExA (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib user32 (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib user32 Alias FindWindowA (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Sub Command1_Click()
Open Environ$(WinDir) & \system32\taskmgr.exe For Binary As #1
Dim hLong As Long
Dim hwnd As Long

hwnd = FindWindow(Shell_TrayWnd, vbNullString)
hLong = FindWindowEx(hwnd, 0, Button, vbNullString)
ShowWindow hLong, SW_HIDE
End Sub

Private Sub Command2_Click()
Close #1
Dim hLong As Long
Dim hwnd As Long

hwnd = FindWindow(Shell_TrayWnd, vbNullString)
hLong = FindWindowEx(hwnd, 0, Button, vbNullString)
ShowWindow hLong, SW_SHOW
End Sub
admin
网友回答2022-01-01
我见过一个类似的软件,感觉难度应该还是很大的,不是那么简单
admin
网友回答2022-01-01
使用Timer定时器,设置计时参数5X60=300秒.
然后设置定时器1S中断.当计时器为0就是5分钟.
将计时器参数显示在文本框中就可以了.
admin
网友回答2022-01-01
Private Sub 开机自动启动_Click(sender As Object, e As EventArgs) Handles 开机自动启动.Click
Dim a As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.CreateSubKey(Software\Microsoft\Windows\CurrentVersion\Run)
a.SetValue(查看.exe, Application.StartupPath & \查看.exe)
End Sub
Private Sub 关闭开机自启_Click(sender As Object, e As EventArgs) Handles 关闭开机自启.Click
Dim a As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.CreateSubKey(Software\Microsoft\Windows\CurrentVersion\Run)
a.DeleteValue(查看.exe)
End Sub
admin
网友回答2022-01-01
大哥,你直说能被187正处就得了……给个完整的吧,不需要控件……
Private Sub form_load()
Form1.AutoRedraw = True
Dim b As Integer
For b = 2000 To 9990
If b Mod 187 = 0 Then
Print b
End If
Next
End Sub
附图:http://hiphotos.baidu.com/pengfirst/pic/item/3a50bc3eddd1f8cf55e72331.jpeg
admin
网友回答2022-01-01
窗体截图 和整个屏幕截图
利用 Alt PrintScr 组合键实现屏幕扑获
Private Declare Sub keybd_event Lib user32 Alias keybd_event (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
call Keybd_event(VK_SNAPSHOT,0,0,0) '将应用窗口图象放到剪贴板
call Keybd_event(VK_SNAPSHOT,1,0,0) '把整个屏幕图象放到剪贴板

在用SendMessage 显示到图片框中 最后保存

回到
顶部