msgdragfrom.bas

来自「vb做的数据库 客户管理系统」· BAS 代码 · 共 20 行

BAS
20
字号
Attribute VB_Name = "msgDragFrom"
Option Explicit

' Used to make the form draggable
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
' Also used to make the form draggable
Public Declare Function ReleaseCapture Lib "user32" () As Long




Public Sub DoDrag(TheForm As Form)
    ' TheForm:  The form you want to start dragging

    If TheForm.WindowState <> vbMaximized Then
        ReleaseCapture
        SendMessage TheForm.hwnd, &HA1, 2, 0&
    End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?