?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "設置窗體置頂"
ClientHeight = 3135
ClientLeft = 60
ClientTop = 405
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3135
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消置頂"
Height = 495
Left = 2520
TabIndex = 1
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "置頂"
Height = 495
Left = 720
TabIndex = 0
Top = 2160
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub OnTop(hwnd As Long, Flag As Boolean)
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
If Flag = True Then
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
Else
SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End If
End Sub
'按鈕
Private Sub Command1_Click()
OnTop Me.hwnd, True '置頂
End Sub
Private Sub Command2_Click()
OnTop Me.hwnd, False '取消置頂
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -