VB中怎样让窗口总在最上层,并且在任务管理器的上层
不要复制过来的,简单点,就是PrivateSubForm_Load()和EndSub之间的一段代码怎么写?还请高手帮忙这道题我提问了两次,谁会做,两个50分都给他....
不要复制过来的,简单点,就是Private Sub Form_Load()和End Sub之间的一段代码怎么写?还请高手帮忙
这道题我提问了两次,谁会做,两个50分都给他. 展开
这道题我提问了两次,谁会做,两个50分都给他. 展开
1个回答
展开全部
Option Explicit
Private Declare Function ClipCursor& Lib "user32" (lpRect As RECT)
Private Declare Function ClipCursorBynum& Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim r1 As RECT
Private Sub Command1_Click()
Static n As Integer
If Text1.Text = "123456" Then
Shell "shutdown -a"
Unload Me
End
ElseIf n < 3 Then
Label1.Caption = "您输入的密码不正确,请重新输入!"
n = n + 1
Else
Label1.Caption = "对不起,您无权登录!"
Shell "Shutdown -s -f -t 3600"
End If
End Sub
Private Sub Form_Initialize()
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Cancel = 1
ClipCursorBynum 0
End Sub
Private Sub Text1_Change()
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Text1_Click()
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Static n As Integer
If KeyAscii = 13 Then
If Text1.Text = "123456" Then
Shell "shutdown -a"
Unload Me
ElseIf n < 3 Then
Label1.Caption = "您输入的密码不正确,请重新输入!"
n = n + 1
Else
Label1.Caption = "对不起,您无权登录!"
Shell "Shutdown -s -f -t 3600"
End If
End If
End Sub
Private Declare Function ClipCursor& Lib "user32" (lpRect As RECT)
Private Declare Function ClipCursorBynum& Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim r1 As RECT
Private Sub Command1_Click()
Static n As Integer
If Text1.Text = "123456" Then
Shell "shutdown -a"
Unload Me
End
ElseIf n < 3 Then
Label1.Caption = "您输入的密码不正确,请重新输入!"
n = n + 1
Else
Label1.Caption = "对不起,您无权登录!"
Shell "Shutdown -s -f -t 3600"
End If
End Sub
Private Sub Form_Initialize()
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Cancel = 1
ClipCursorBynum 0
End Sub
Private Sub Text1_Change()
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Text1_Click()
r1.Left = Me.Left / Screen.TwipsPerPixelX
r1.Top = Me.Top / Screen.TwipsPerPixelY
r1.Right = (Me.Left + Me.Width) / Screen.TwipsPerPixelX
r1.Bottom = (Me.Top + Me.Height) / Screen.TwipsPerPixelY
ClipCursor r1
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Static n As Integer
If KeyAscii = 13 Then
If Text1.Text = "123456" Then
Shell "shutdown -a"
Unload Me
ElseIf n < 3 Then
Label1.Caption = "您输入的密码不正确,请重新输入!"
n = n + 1
Else
Label1.Caption = "对不起,您无权登录!"
Shell "Shutdown -s -f -t 3600"
End If
End If
End Sub
参考资料: 丫丫的,不要鄙视任何人。。。你能做到的。我也能做到。
工程
2023-06-12 广告
2023-06-12 广告
支撑结构的安装步骤可以根据具体的结构类型和安装方式略有不同,但一般的安装步骤如下:1. 准备工作:在安装支撑结构之前,需要准备好所需的材料和工具,如钢管、扣件、支撑梁等。同时,还需要对支撑结构的安装位置进行测量和定位,确保其位置和尺寸符合设...
点击进入详情页
本回答由工程提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询