📄 scombobox.ctl
字号:
End If
Call SetWindowPos(picList.hwnd, -1, 0, 0, 1, 1, SWP_NOMOVE Or SWP_NOSIZE Or SWP_FRAMECHANGED)
Call scrollI.Move(picList.ScaleWidth - 18, 1)
If (NumberItemsToShow < MaxListLength) Then
scrollI.Height = picList.ScaleHeight - 2
scrollI.Visible = True
Else
scrollI.Visible = False
End If
Call SetWindowPos(scrollI.hwnd, -1, 0, 0, 1, 1, SWP_NOMOVE Or SWP_NOSIZE Or SWP_FRAMECHANGED)
Call DrawAppearance(myAppearanceCombo, 3)
If (myAppearanceCombo = 2) Or ((myAppearanceCombo = 3) And ((myXpAppearance = 7) Or (myXpAppearance = 0))) Then
Call Espera(0.09)
Call DrawAppearance(myAppearanceCombo, 1)
End If
ItemFocus = FindItemText(myText, 2)
Call DrawList(scrollI.Value, NumberItemsToShow)
picList.Visible = True
Else
Call DrawAppearance(myAppearanceCombo, 2)
picList.Visible = False
First = 0
End If
End Sub
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If (picList.Visible = False) Then tmrFocus.Enabled = True
End Sub
Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If (picList.Visible = False) Then tmrFocus.Enabled = True
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Alignment = PropBag.ReadProperty("Alignment", 0)
AppearanceCombo = PropBag.ReadProperty("AppearanceCombo", defAppearanceCombo)
ArrowColor = PropBag.ReadProperty("ArrowColor", defArrowColor)
AutoCompleteWord = PropBag.ReadProperty("AutoCompleteWord", False)
BackColor = PropBag.ReadProperty("BackColor", defListColor)
Call ControlsSubClasing
DisabledColor = PropBag.ReadProperty("DisabledColor", defDisabledColor)
Set DisabledPictureUser = PropBag.ReadProperty("DisabledPictureUser", Nothing)
Enabled = PropBag.ReadProperty("Enabled", True)
GradientColor1 = PropBag.ReadProperty("GradientColor1", defGradientColor1)
GradientColor2 = PropBag.ReadProperty("GradientColor2", defGradientColor2)
Set FocusPictureUser = PropBag.ReadProperty("FocusPictureUser", Nothing)
Set g_Font = PropBag.ReadProperty("Font", Ambient.Font)
HighLightBorderColor = PropBag.ReadProperty("HighLightBorderColor", defHighLightBorderColor)
HighLightColorText = PropBag.ReadProperty("HighLightColorText", defHighLightColorText)
Set HighLightPictureUser = PropBag.ReadProperty("HighLightPictureUser", Nothing)
ListColor = PropBag.ReadProperty("ListColor", defListColor)
ListGradient = PropBag.ReadProperty("ListGradient", False)
ListPositionShow = PropBag.ReadProperty("ListPositionShow", defListShown)
MaxListLength = PropBag.ReadProperty("MaxListLength", "10")
Set MouseIcon = PropBag.ReadProperty("MouseIcon", Nothing)
MousePointer = PropBag.ReadProperty("MousePointer", 0)
NormalBorderColor = PropBag.ReadProperty("NormalBorderColor", defNormalBorderColor)
NormalColorText = PropBag.ReadProperty("NormalColorText", defNormalColorText)
Set NormalPictureUser = PropBag.ReadProperty("NormalPictureUser", Nothing)
NumberItemsToShow = PropBag.ReadProperty("NumberItemsToShow", "7")
OfficeAppearance = PropBag.ReadProperty("OfficeAppearance", defOfficeAppearance)
SelectBorderColor = PropBag.ReadProperty("SelectBorderColor", defSelectBorderColor)
SelectListBorderColor = PropBag.ReadProperty("SelectListBorderColor", defSelectListBorderColor)
SelectListColor = PropBag.ReadProperty("SelectListColor", defSelectListColor)
ShadowColorText = PropBag.ReadProperty("ShadowColorText", defShadowColorText)
Style = PropBag.ReadProperty("Style", defStyleCombo)
Text = PropBag.ReadProperty("Text", Ambient.DisplayName)
XpAppearance = PropBag.ReadProperty("XpAppearance", 1)
End Sub
Private Sub UserControl_Resize()
Call IsEnabled(ControlEnabled)
Call IsEnabled(ControlEnabled)
End Sub
Private Sub UserControl_Show()
Dim lResult As Long
On Error Resume Next
lResult = GetWindowLong(picList.hwnd, GWL_EXSTYLE)
Call SetWindowLong(picList.hwnd, GWL_EXSTYLE, lResult Or WS_EX_TOOLWINDOW)
Call SetWindowPos(picList.hwnd, picList.hwnd, 0, 0, 0, 0, 39)
Call SetWindowLong(picList.hwnd, -8, Parent.hwnd)
Call SetParent(picList.hwnd, 0)
lResult = GetWindowLong(scrollI.hwnd, GWL_EXSTYLE)
Call SetWindowLong(scrollI.hwnd, GWL_EXSTYLE, lResult Or WS_EX_TOOLWINDOW)
Call SetWindowPos(scrollI.hwnd, scrollI.hwnd, 0, 0, 0, 0, 39)
Call SetWindowLong(scrollI.hwnd, -8, Parent.hwnd)
Call SetParent(scrollI.hwnd, picList.hwnd)
If (IsPicture = False) Then txtCombo.Left = 8
End Sub
Private Sub UserControl_Terminate()
On Error Resume Next
Erase ListContents
Set picTemp = Nothing
Set scrollI = Nothing
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Alignment", myAlignCombo, 0)
Call PropBag.WriteProperty("AppearanceCombo", myAppearanceCombo, defAppearanceCombo)
Call PropBag.WriteProperty("ArrowColor", myArrowColor, defArrowColor)
Call PropBag.WriteProperty("AutoCompleteWord", myAutoSel, False)
Call PropBag.WriteProperty("BackColor", myBackColor, defListColor)
Call PropBag.WriteProperty("DisabledColor", myDisabledColor, defDisabledColor)
Call PropBag.WriteProperty("DisabledPictureUser", myDisabledPictureUser, Nothing)
Call PropBag.WriteProperty("Enabled", Enabled, True)
Call PropBag.WriteProperty("FocusPictureUser", myFocusPictureUser, Nothing)
Call PropBag.WriteProperty("Font", g_Font, Ambient.Font)
Call PropBag.WriteProperty("GradientColor1", myGradientColor1, defGradientColor1)
Call PropBag.WriteProperty("GradientColor2", myGradientColor2, defGradientColor2)
Call PropBag.WriteProperty("HighLightBorderColor", myHighLightBorderColor, defHighLightBorderColor)
Call PropBag.WriteProperty("HighLightColorText", myHighLightColorText, defHighLightColorText)
Call PropBag.WriteProperty("HighLightPictureUser", myHighLightPictureUser, Nothing)
Call PropBag.WriteProperty("ListColor", myListColor, defListColor)
Call PropBag.WriteProperty("ListGradient", myListGradient, False)
Call PropBag.WriteProperty("ListPositionShow", myListShown, defListShown)
Call PropBag.WriteProperty("MaxListLength", ListMaxL, "10")
Call PropBag.WriteProperty("MouseIcon", myMouseIcon, Nothing)
Call PropBag.WriteProperty("MousePointer", myMousePointer, 0)
Call PropBag.WriteProperty("NormalBorderColor", myNormalBorderColor, defNormalBorderColor)
Call PropBag.WriteProperty("NormalColorText", myNormalColorText, defNormalColorText)
Call PropBag.WriteProperty("NormalPictureUser", myNormalPictureUser, Nothing)
Call PropBag.WriteProperty("NumberItemsToShow", myItemsShow, "7")
Call PropBag.WriteProperty("OfficeAppearance", myOfficeAppearance, defOfficeAppearance)
Call PropBag.WriteProperty("SelectBorderColor", mySelectBorderColor, defSelectBorderColor)
Call PropBag.WriteProperty("SelectListBorderColor", mySelectListBorderColor, defSelectListBorderColor)
Call PropBag.WriteProperty("SelectListColor", mySelectListColor, defSelectListColor)
Call PropBag.WriteProperty("ShadowColorText", myShadowColorText, defShadowColorText)
Call PropBag.WriteProperty("Style", myStyleCombo, defStyleCombo)
Call PropBag.WriteProperty("Text", myText, Ambient.DisplayName)
Call PropBag.WriteProperty("XpAppearance", myXpAppearance, 1)
End Sub
'*******************************************'
'* English: Properties of the Usercontrol. *'
'* Espa駉l: Propiedades del Usercontrol. *'
'*******************************************'
Public Property Get Alignment() As AlignTextCombo
Attribute Alignment.VB_Description = "Sets/Gets alignment of the text in the list."
'* English: Sets/Gets alignment of the text in the list.
'* Espa駉l: Devuelve o establece la alineaci髇 del texto en la lista.
Alignment = myAlignCombo
End Property
Public Property Let Alignment(ByVal New_Align As AlignTextCombo)
myAlignCombo = New_Align
Call PropertyChanged("Alignment")
Refresh
End Property
Public Property Get AppearanceCombo() As ComboAppearance
Attribute AppearanceCombo.VB_Description = "Sets/Gets the style of the Combo."
'* English: Sets/Gets the style of the Combo.
'* Espa駉l: Devuelve o establece el estilo del Combo.
AppearanceCombo = myAppearanceCombo
End Property
Public Property Let AppearanceCombo(ByVal New_Style As ComboAppearance)
myAppearanceCombo = IIf(New_Style <= 0, 1, New_Style)
Call IsEnabled(ControlEnabled)
Call PropertyChanged("AppearanceCombo")
Refresh
End Property
Public Property Get ArrowColor() As OLE_COLOR
Attribute ArrowColor.VB_Description = "Sets/Gets the color of the arrow."
'* English: Sets/Gets the color of the arrow.
'* Espa駉l: Devuelve o establece el color de la flecha.
ArrowColor = myArrowColor
End Property
Public Property Let ArrowColor(ByVal New_Color As OLE_COLOR)
myArrowColor = ConvertSystemColor(New_Color)
Call IsEnabled(ControlEnabled)
Call PropertyChanged("ArrowColor")
Refresh
End Property
Public Property Get AutoCompleteWord() As Boolean
Attribute AutoCompleteWord.VB_Description = "Sets/Gets complete the word with a similar element of the list."
'* English: Sets/Gets complete the word with a similar element of the list.
'* Espa駉l: Devuelve o establece si se completa la palabra con un elemento similar de la lista.
AutoCompleteWord = myAutoSel
End Property
'* Note: When this property this active one and the list _
is shown, it is not tried to locate the element _
in the list to make quicker the search of the _
text to complete.
'* Nota: Cuando esta propiedad este activa y la lista se _
muestre, no se intentara ubicar el elemento en la _
lista para hacer m醩 r醦ido la b鷖queda del texto _
a completar.
Public Property Let AutoCompleteWord(ByVal New_Value As Boolean)
myAutoSel = New_Value
Call PropertyChanged("AutoCompleteWord")
Refresh
End Property
Public Property Get BackColor() As OLE_COLOR
Attribute BackColor.VB_Description = "Sets/Gets the color of the Usercontrol."
'* English: Sets/Gets the color of the Usercontrol.
'* Espa駉l: Devuelve o establece el color del Usercontrol.
BackColor = myBackColor
End Property
Public Property Let BackColor(ByVal New_Color As OLE_COLOR)
myBackColor = ConvertSystemColor(GetLngColor(New_Color))
Call IsEnabled(ControlEnabled)
Call PropertyChanged("BackColor")
Refresh
End Property
Public Property Get DisabledColor() As OLE_COLOR
Attribute DisabledColor.VB_Description = "Sets/Gets the color of the disabled text."
'* English: Sets/Gets the color of the disabled text.
'* Espa駉l: Devuelve o establece el color del texto deshabilitado.
DisabledColor = ShiftColorOXP(myDisabledColor, 94)
End Property
Public Property Let DisabledColor(ByVal New_Color As OLE_COLOR)
myDisabledColor = ConvertSystemColor(GetLngColor(New_Color))
Call IsEnabled(ControlEnabled)
Call PropertyChanged("DisabledColor")
Refresh
End Property
Public Property Get DisabledPictureUser() As StdPicture
Attribute DisabledPictureUser.VB_Description = "Sets/Gets an image like topic of the Combo when the Object is not enabled."
'* English: Sets/Gets an image like topic of the Combo when the Object is not enabled.
'* Espa駉l: Devuelve o establece una imagen como tema del combo cuando el Objeto este inactivo.
Set DisabledPictureUser = myDisabledPictureUser
End Property
Public Property Set DisabledPictureUser(ByVal New_Picture As StdPicture)
Set myDisabledPictureUser = New_Picture
Call IsEnabled(ControlEnabled)
Call PropertyChanged("DisabledPictureUser")
Refresh
End Property
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "Sets/Gets the Enabled property of the control."
'* English: Sets/Gets the Enabled property of the control.
'* Espa駉l: Devuelve o establece si el Usercontrol esta habilitado ?deshabilitado.
Enabled = UserControl.Enabled
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
UserControl.Enabled = New_Enabled
ControlEnabled = New_Enabled
Call IsEnabled(New_Enabled)
Call PropertyChanged("Enabled")
End Property
Public Property Get FocusPictureUser() As StdPicture
Attribute FocusPictureUser.VB_Description = "Sets/Gets the image like topic of the Combo when It has the focus."
'* English: Sets/Gets the image like topic of the Combo when It has the focus.
'* Espa駉l: Devuelve o establece una imagen como tema del combo cuando se tiene el enfoque.
Set FocusPictureUser = myFocusPictureUser
End Property
Public Property Set FocusPictureUser(ByVal New_Picture As StdPicture)
Set myFocusPictureUser = New_Picture
Call PropertyChanged("FocusPictureUser")
Refresh
End Property
Public Property Get Font() As StdFont
Attribute Font.VB_Description = "Set the Font of the control."
'* English: Sets/Gets the Font of the control.
'* Espa駉l: Devuelve o establece el tipo de fuente del texto.
Set Font = g_Font
End Property
Public Property Set Font(ByVal New_Font As StdFont)
On Error Resume Next
With g_Font
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -