📄 mod_public_frm.bas
字号:
Attribute VB_Name = "Mod_public_Frm"
'
'' *************窗体自动大小********************
'' * Code by Robert Wright - <rob@xenonic.com> *
'' *********************************************
'
'' *********************************************
'' * -> This code is FREEWARE <- *
'' * You are free to use this any of this VB *
'' * Project (including the images) in your *
'' * own programs. *
'' * *
'' * All I ask is that you vote for me on PSC! *
'' *********************************************
'
'' Used to set the shape of the form
'Public Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
'' Used to create the rounded rectangle region
'Public Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
'' 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
'' Used to make the window always on top
'Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, Y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'' Various constants used by the above functions
'Public Const HWND_TOPMOST = -1
'Public Const HWND_NOTOPMOST = -2
'Public Const SWP_NOMOVE = &H2
'Public Const SWP_NOSIZE = &H1
'Public Const SWP_NOACTIVATE = &H10
'Public Const SWP_SHOWWINDOW = &H40
'Public Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
'
'Public Buffer(0 To 10) As Variant
'
'
'
'
'
'Public Sub MakeWindow(TheForm As Form)
'' TheForm: The form you want to make graphical
'' TheForm.Show
'
'
' DoTransparency TheForm
'End Sub
'
'Public Sub DoTransparency(TheForm As Form)
'' TheForm: The form you want to be rounded rectangle shape
'
' Dim TempRegions(6) As Long
' Dim FormWidthInPixels As Long
' Dim FormHeightInPixels As Long
' Dim a
'
'' Convert the form's height and width from twips to pixels
' FormWidthInPixels = TheForm.Width / Screen.TwipsPerPixelX
' FormHeightInPixels = TheForm.Height / Screen.TwipsPerPixelY
'
'' Make a rounded rectangle shaped region with the dimentions of the form
' a = CreateRoundRectRgn(0, 0, FormWidthInPixels, FormHeightInPixels, 24, 24)
'
'' Set this region as the shape for "TheForm"
' a = SetWindowRgn(TheForm.hWnd, a, True)
'End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -