📄 clslabel.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsLabel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
' Window Style
Private Const CW_USEDEFAULT = &H80000000
' Static Style
Private Const SS_ENHMETAFILE = &HF
Private Const SS_BITMAP = &HE
Private Const SS_SIMPLE = &HB
Private hStatic As Long
Public Function CreateLabel(hWnd As Long, strText As String, X&, Y&, Optional hWndFont As Long, Optional Style As Long, Optional ID As Long)
hStatic = CreateWindowEx(0&, "STATIC", strText, Style Or WS_CHILD Or WS_VISIBLE _
Or SS_SIMPLE, X, Y, 200, 18&, hWnd, ID, App.hInstance, 0)
Call SendMessage(hStatic, WM_SETFONT, hWndFont, 1)
End Function
Public Property Get hWnd() As Long
hWnd = hStatic
End Property
Private Sub Class_Initialize()
hStatic = 0
End Sub
Private Sub Class_Terminate()
Dim N As Long
If hStatic <> 0 Then
DestroyWindow hStatic
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -