📄 scombobox.ctl
字号:
Private Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
'* English: Elements of the list.
'* Espa駉l: Elementos de la lista.
Private Type PropertyCombo
Color As OLE_COLOR '* Color of Text.
Enabled As Boolean '* Item Enabled or Disabled.
Image As StdPicture '* Item image.
Index As Long '* Index item.
MouseIcon As StdPicture '* Set MouseIcon for each item.
SeparatorLine As Boolean '* Set SeparatorLine for each group that you consider necessary.
Tag As String '* Extra Information only if is necessary.
Text As String '* Text of the item.
TextShadow As Boolean '* Shadow text item.
ToolTipText As String '* ToolTipText for item.
End Type
Private Type TRIVERTEX
x As Long
y As Long
Red As Integer
Green As Integer
Blue As Integer
Alpha As Integer
End Type
'*********************************************'
'* English: Public Enum of Control. *'
'* Espa駉l: Enumeraci髇 Publica del control. *'
'*********************************************'
'* English: Enum for the alignment of the text of the list.
'* Espa駉l: Enum para la alineaci髇 del texto de la lista.
Public Enum AlignTextCombo
AlignLeft = 0
AlignRight = 1
AlignCenter = 2
End Enum
'* English: Appearance Combo.
'* Espa駉l: Apariencias del Combo.
Public Enum ComboAppearance
Office = 1 '* By fred.cpp & HACKPRO TM.
Win98 = 2 '* By fred.cpp.
WinXp = 3 '* By fred.cpp & HACKPRO TM.
[Soft Style] = 4 '* By fred.cpp.
KDE = 5 '* By HACKPRO TM.
Mac = 6 '* By fred.cpp & HACKPRO TM.
JAVA = 7 '* By fred.cpp.
[Explorer Bar] = 8 '* By HACKPRO TM.
Picture = 9 '* By HACKPRO TM.
[Special Borde] = 10 '* By HACKPRO TM.
Circular = 11 '* By HACKPRO TM.
[GradientV] = 12 '* By HACKPRO TM.
[GradientH] = 13 '* By HACKPRO TM.
[Light Blue] = 14 '* By HACKPRO TM.
[Style Arrow] = 15 '* By HACKPRO TM.
[NiaWBSS] = 16 '* By HACKPRO TM.
[Rhombus] = 17 '* By HACKPRO TM.
[Additional Xp] = 18 '* By HACKPRO TM.
[Ardent] = 19 '* By HACKPRO TM.
[Chocolate] = 20 '* By HACKPRO TM.
[Button Download] = 21 '* By HACKPRO TM.
End Enum
'* English: Type of Combo and behavior of the list.
'* Espa駉l: Tipo de Combo y comportamiento de la lista.
Public Enum ComboStyle
[Dropdown Combo] = 0
[Dropdown List] = 1
End Enum
'* English: Appearance standard style Office.
'* Espa駉l: Apariencias est醤dares del estilo Office.
Public Enum ComboOfficeAppearance
[Office Xp] = 0 '* By HACKPRO TM.
[Office 2000] = 1 '* By fred.cpp.
[Office 2003] = 2 '* By HACKPRO TM.
End Enum
'* English: Appearance standard style Xp.
'* Espa駉l: Apariencias est醤dares del estilo Xp.
Public Enum ComboXpAppearance
[Windows Themed] = 0 '* By fred.cpp
Aqua = 1 '* By HACKPRO TM.
[Olive Green] = 2 '* By HACKPRO TM.
Silver = 3 '* By HACKPRO TM.
TasBlue = 4 '* By HACKPRO TM.
Gold = 5 '* By HACKPRO TM.
Blue = 6 '* By HACKPRO TM.
CustomXP = 7 '* By HACKPRO TM.
End Enum
'* English: Direction of like the list is shown.
'* Espa駉l: Direcci髇 de como se muestra la lista.
Public Enum ListDirection
[Show Down] = 0
[Show Up] = 1
End Enum
'* English: Enum for the type of text comparison.
'* Espa駉l: Enum para el tipo de comparaci髇 de texto.
Public Enum StringCompare
None = 0
ExactWord = 1
CompleteWord = 2
End Enum
'********************************'
'* English: Private variables. *'
'* Espa駉l: Variables privadas. *'
'********************************'
Private BigText As String
Private ControlEnabled As Boolean
Private cValor As Long
Private CurrentS As Long
Private First As Integer
Private FirstView As Integer
Private g_Font As StdFont
Private HighlightedItem As Long
Private iFor As Long
Private IndexItemNow As Long
Private IsMsg As MSG
Private IsPicture As Boolean
Private ItemFocus As Long
Private KeyPos As Integer
Private ListContents() As PropertyCombo
Private ListMaxL As Long
Private m_btnRect As RECT
Private m_bOver As Boolean
Private m_LeaveMouse As Boolean
Private m_StateG As Integer
Private myAlignCombo As AlignTextCombo
Private myAppearanceCombo As ComboAppearance
Private myArrowColor As OLE_COLOR
Private myAutoSel As Boolean
Private myBackColor As OLE_COLOR
Private myListColor As OLE_COLOR
Private myDisabledColor As OLE_COLOR
Private myDisabledPictureUser As StdPicture
Private myFocusPictureUser As StdPicture
Private myGradientColor1 As OLE_COLOR
Private myGradientColor2 As OLE_COLOR
Private myHighLightBorderColor As OLE_COLOR
Private myHighLightColorText As OLE_COLOR
Private myHighLightPictureUser As StdPicture
Private myItemsShow As Long
Private myListGradient As Boolean
Private myListShown As ListDirection
Private myMouseIcon As StdPicture
Private myMousePointer As MousePointerConstants
Private myNormalBorderColor As OLE_COLOR
Private myNormalColorText As OLE_COLOR
Private myNormalPictureUser As StdPicture
Private myOfficeAppearance As ComboOfficeAppearance
Private mySelectBorderColor As OLE_COLOR
Private mySelectListBorderColor As OLE_COLOR
Private mySelectListColor As OLE_COLOR
Private myShadowColorText As OLE_COLOR
Private myStyleCombo As ComboStyle
Private myText As String
Private myXpAppearance As ComboXpAppearance
Private OrderListContents() As PropertyCombo
Private RGBColor As RGB
Private sumItem As Long
Private tempBorderColor As OLE_COLOR
Private tmpC1 As Long
Private tmpC2 As Long
Private tmpC3 As Long
Private tmpcolor As Long
'***************************************'
'* English: Constant declares. *'
'* Espa駉l: Declaraci髇 de Constantes. *'
'***************************************'
Private Const BDR_RAISEDINNER = &H4
Private Const BDR_SUNKENOUTER = &H2
Private Const BF_RECT = (&H1 Or &H2 Or &H4 Or &H8)
Private Const COLOR_BTNFACE = 15
Private Const COLOR_BTNSHADOW = 16
Private Const COLOR_GRADIENTACTIVECAPTION As Long = 27
Private Const COLOR_GRADIENTINACTIVECAPTION As Long = 28
Private Const COLOR_GRAYTEXT As Long = 17
Private Const COLOR_HIGHLIGHT As Long = 13
Private Const COLOR_HOTLIGHT As Long = 26
Private Const COLOR_INACTIVECAPTIONTEXT As Long = 19
Private Const COLOR_WINDOW = 5
Private Const defAppearanceCombo = 1
Private Const defArrowColor = &HC56A31
Private Const defDisabledColor = &H808080
Private Const defGradientColor1 = &HDAB278
Private Const defGradientColor2 = &HFFDD9E
Private Const defHighLightBorderColor = &HC56A31
Private Const defHighLightColorText = &HFFFFFF
Private Const defNormalBorderColor = &HDEEDEF
Private Const defNormalColorText = &HC56A31
Private Const defListColor = &HFFFFFF
Private Const defListShown = 0
Private Const defOfficeAppearance = 0
Private Const defSelectBorderColor = &HC56A31
Private Const defSelectListBorderColor = &H6B2408
Private Const defSelectListColor = &HC56A31
Private Const defShadowColorText = &H80000015
Private Const defStyleCombo = 0
Private Const DSS_DISABLED = &H20
Private Const DSS_NORMAL = &H0
Private Const DST_BITMAP = &H3
Private Const DST_COMPLEX = &H0
Private Const DST_ICON = &H3
Private Const DST_TEXT = &H2
Private Const EDGE_RAISED = (&H1 Or &H4)
Private Const EDGE_SUNKEN = (&H2 Or &H8)
Private Const GRADIENT_FILL_RECT_H As Long = &H0
Private Const GRADIENT_FILL_RECT_V As Long = &H1
Private Const GWL_EXSTYLE = -20
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const WS_EX_TOOLWINDOW = &H80
Private Const Version As String = "SComboBox 1.0.3 By HACKPRO TM"
Private Const VK_LBUTTON = &H1
Private Const VK_RBUTTON = &H2
Private Const WM_MOUSELEAVE As Integer = &H2A3
Private Const WM_MOUSEWHEEL As Integer = &H20A
'*******************************'
'* English: Private WithEvents *'
'* Espa駉l: Private WithEvents *'
'*******************************'
Private WithEvents scrollI As VScrollBar
Attribute scrollI.VB_VarHelpID = -1
Private WithEvents picTemp As PictureBox
Attribute picTemp.VB_VarHelpID = -1
'******************************'
'* English: Public Events. *'
'* Espa駉l: Eventos P鷅licos. *'
'******************************'
Public Event SelectionMade(ByVal SelectedItem As String, ByVal SelectedItemIndex As Long)
Public Event TotalItems(ByVal ListCount As Long)
'**********************************'
'* English: Calls to the API's. *'
'* Espa駉l: Llamadas a los API's. *'
'**********************************'
Private Declare Function CloseThemeData Lib "uxtheme.dll" (ByVal hTheme As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) 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 CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function DispatchMessage Lib "USER32" Alias "DispatchMessageA" (lpMsg As MSG) As Long
Private Declare Function DrawEdge Lib "USER32" (ByVal hDC As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long
Private Declare Function DrawState Lib "USER32" Alias "DrawStateA" (ByVal hDC As Long, ByVal hBrush As Long, ByVal lpDrawStateProc As Long, ByVal lParam As Long, ByVal wParam As Long, ByVal x As Long, ByVal y As Long, ByVal cX As Long, ByVal cY As Long, ByVal flags As Long) As Long
Private Declare Function DrawStateString Lib "USER32" Alias "DrawStateA" (ByVal hDC As Long, ByVal hBrush As Long, ByVal lpDrawStateProc As Long, ByVal lpString As String, ByVal cbStringLen As Long, ByVal x As Long, ByVal y As Long, ByVal cX As Long, ByVal cY As Long, ByVal fuFlags As Long) As Long
Private Declare Function DrawThemeBackground Lib "uxtheme.dll" (ByVal hTheme As Long, ByVal lhdc As Long, ByVal iPartId As Long, ByVal iStateId As Long, pRect As RECT, pClipRect As RECT) As Long
Private Declare Function FrameRect Lib "USER32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function FillRect Lib "USER32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function GetAsyncKeyState Lib "USER32" (ByVal vKey As Long) As Integer
Private Declare Function GetCursorPos Lib "USER32" (lpPoint As POINTAPI) As Long
Private Declare Function GetMessage Lib "USER32" Alias "GetMessageA" (lpMsg As MSG, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetSysColor Lib "USER32" (ByVal nIndex As Long) As Long
Private Declare Function GetSystemMetrics Lib "USER32" (ByVal nIndex As Long) As Long
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function GetWindowDC Lib "USER32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetWindowRect Lib "USER32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GradientFillRect Lib "msimg32" Alias "GradientFill" (ByVal hDC As Long, pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As GRADIENT_RECT, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Private Declare Function OleTranslateColor Lib "oleaut32.dll" (ByVal lOleColor As Long, ByVal lHPalette As Long, lColorRef As Long) As Long
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -