📄 frmmain.frm
字号:
VERSION 5.00
Begin VB.Form FrmMain
Caption = "窗口消息"
ClientHeight = 3285
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3285
ScaleWidth = 4680
ShowInTaskbar = 0 'False
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请在窗口标题上按下鼠标右键"
Height = 180
Left = 1200
TabIndex = 0
Top = 1185
Width = 2340
End
Begin VB.Menu MnuFile
Caption = "文件"
Visible = 0 'False
Begin VB.Menu MenuItem1
Caption = "MenuItem1"
End
Begin VB.Menu MenuItem2
Caption = "MenuItem2"
End
Begin VB.Menu MenuItem3
Caption = "MenuItem3"
End
Begin VB.Menu MenuItem4
Caption = "MenuItem4"
End
End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub ProcMsg(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, Result As Long)
On Error Resume Next
Select Case uMsg
Case WM_NCRBUTTONUP
PopupMenu MnuFile
End Select
End Sub
Private Sub Form_Load()
On Error Resume Next
Label1.Left = (Me.ScaleWidth - Label1.Width) / 2
Label1.Top = (Me.ScaleHeight - Label1.Height) / 2
Call SetWindowLong(Me.hWnd, GWL_EXSTYLE, CLng(WS_EX_PALETTEWINDOW))
SubClass Me.hWnd
MdiMain.Picture1.BorderStyle = 0
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call SetParent(Me.hWnd, MdiMain.hWnd)
MdiMain.Picture1.Visible = False
End Sub
Private Sub UnSubClass()
Dim hWndCur As Long
hWndCur = Me.hWnd
If NextProcs Then
SetWindowLong hWndCur, GWL_WNDPROC, NextProcs
NextProcs = 0
End If
End Sub
Private Sub SubClass(hWnd As Long)
On Error Resume Next
NextProcs = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
Private Sub Form_Resize()
Label1.Left = (Me.ScaleWidth - Label1.Width) / 2
Label1.Top = (Me.ScaleHeight - Label1.Height) / 2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -