📄 mytitlebar.ctl
字号:
VERSION 5.00
Begin VB.UserControl MicTitleBar
ClientHeight = 1305
ClientLeft = 0
ClientTop = 0
ClientWidth = 5580
ScaleHeight = 87
ScaleMode = 3 'Pixel
ScaleWidth = 372
ToolboxBitmap = "MyTitleBar.ctx":0000
Begin VB.PictureBox PicUn
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 4320
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 8
Top = 840
Width = 225
End
Begin VB.PictureBox Picture000
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 750
Left = 1200
ScaleHeight = 750
ScaleWidth = 720
TabIndex = 6
Top = 480
Width = 720
End
Begin VB.PictureBox PicMaxU
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 4800
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 5
ToolTipText = "最大化"
Top = 60
Width = 225
End
Begin VB.PictureBox PicMin
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 4455
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 4
Top = 480
Width = 225
End
Begin VB.PictureBox PicMax
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 4800
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 3
Top = 480
Width = 225
End
Begin VB.PictureBox PicClose
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 5160
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 2
Top = 480
Width = 225
End
Begin VB.PictureBox PicCloseU
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 5160
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 1
ToolTipText = "关闭"
Top = 60
Width = 225
End
Begin VB.PictureBox PicMinU
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 240
Left = 4440
ScaleHeight = 16
ScaleMode = 3 'Pixel
ScaleWidth = 15
TabIndex = 0
ToolTipText = "最小化"
Top = 60
Width = 225
End
Begin VB.Image ImageIco
Height = 240
Left = 120
Stretch = -1 'True
Top = 50
Width = 255
End
Begin VB.Label LabelC
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Left = 480
TabIndex = 7
Top = 60
Width = 105
End
Begin VB.Image ImageM
Height = 360
Left = 240
Stretch = -1 'True
Top = 0
Width = 615
End
Begin VB.Image ImageR
Height = 360
Left = 1440
Top = 0
Width = 105
End
Begin VB.Image ImageL
Height = 375
Left = 0
Top = 0
Width = 135
End
End
Attribute VB_Name = "MicTitleBar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRGN As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Const RGN_OR = 2
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Function ReadIni(AppName As String, KeyName As String, FileName As String)
Dim Ret As String
Dim NC As Integer
Ret = String(1024, 0)
NC = GetPrivateProfileString(AppName, KeyName, "", Ret, 1024, FileName)
If NC <> 0 Then Ret = Left$(Ret, NC)
ReadIni = Ret
End Function
Private Function WriteIni(AppName As String, KeyName As String, lpString As String, FileName As String)
WritePrivateProfileString AppName, KeyName, lpString, FileName
End Function
Private Sub ImageL_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Call ReleaseCapture
Call SendMessage(UserControl.Parent.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Private Sub ImageM_DblClick()
If PicMaxU.Enabled = True Then
Call PicMaxU_Click
End If
End Sub
Private Sub ImageM_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Call ReleaseCapture
Call SendMessage(UserControl.Parent.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Private Sub ImageR_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Call ReleaseCapture
Call SendMessage(UserControl.Parent.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -