gcombo.ctl
来自「很好! 很实用! 免费!」· CTL 代码 · 共 576 行 · 第 1/2 页
CTL
576 行
Public Property Get FontSize() As Single
FontSize = Combo1.FontSize
End Property
Public Property Let FontSize(ByVal New_FontSize As Single)
Combo1.FontSize() = New_FontSize
PropertyChanged "FontSize"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,FontName
Public Property Get FontName() As String
FontName = Combo1.FontName
End Property
Public Property Let FontName(ByVal New_FontName As String)
Combo1.FontName() = New_FontName
PropertyChanged "FontName"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,FontItalic
Public Property Get FontItalic() As Boolean
FontItalic = Combo1.FontItalic
End Property
Public Property Let FontItalic(ByVal New_FontItalic As Boolean)
Combo1.FontItalic() = New_FontItalic
PropertyChanged "FontItalic"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,FontBold
Public Property Get FontBold() As Boolean
FontBold = Combo1.FontBold
End Property
Public Property Let FontBold(ByVal New_FontBold As Boolean)
Combo1.FontBold() = New_FontBold
PropertyChanged "FontBold"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,FillStyle
Public Property Get FillStyle() As Integer
FillStyle = UserControl.FillStyle
End Property
Public Property Let FillStyle(ByVal New_FillStyle As Integer)
UserControl.FillStyle() = New_FillStyle
PropertyChanged "FillStyle"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,FillColor
Public Property Get FillColor() As OLE_COLOR
FillColor = UserControl.FillColor
End Property
Public Property Let FillColor(ByVal New_FillColor As OLE_COLOR)
UserControl.FillColor() = New_FillColor
PropertyChanged "FillColor"
End Property
Private Sub UserControl_GetDataMember(DataMember As String, Data As Object)
RaiseEvent GetDataMember(DataMember, Data)
End Sub
Public Sub SelectItem(ByVal sItem As String, ByVal sItemData As String)
Dim i As Integer
For i = 0 To Combo1.ListCount - 1
If Item(sItem, i) = sItemData Then
Combo1.ListIndex = i
Exit Sub
End If
Next i
End Sub
Public Sub RemoveItem(ByVal index As Integer)
Dim iData As String
Dim i As Integer
iData = CStr(Combo1.ItemData(index))
For i = dicItem.Count - 1 To 0 Step -1
If InStrRev(dicItem.Keys(i), "A" + iData + "A") > 0 Then
dicItem.Remove dicItem.Keys(i)
End If
Next i
Combo1.RemoveItem index
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,FontUnderline
Public Property Get FontUnderline() As Boolean
FontUnderline = Combo1.FontUnderline
End Property
Public Property Let FontUnderline(ByVal New_FontUnderline As Boolean)
Combo1.FontUnderline() = New_FontUnderline
PropertyChanged "FontUnderline"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,FontTransparent
Public Property Get FontTransparent() As Boolean
FontTransparent = UserControl.FontTransparent
End Property
Public Property Let FontTransparent(ByVal New_FontTransparent As Boolean)
UserControl.FontTransparent() = New_FontTransparent
PropertyChanged "FontTransparent"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,FontStrikethru
Public Property Get FontStrikethru() As Boolean
FontStrikethru = Combo1.FontStrikethru
End Property
Public Property Let FontStrikethru(ByVal New_FontStrikethru As Boolean)
Combo1.FontStrikethru() = New_FontStrikethru
PropertyChanged "FontStrikethru"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,ListIndex
Public Property Get ListIndex() As Integer
ListIndex = Combo1.ListIndex
End Property
Public Property Let ListIndex(ByVal New_ListIndex As Integer)
Combo1.ListIndex() = New_ListIndex
PropertyChanged "ListIndex"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,ListCount
Public Property Get ListCount() As Integer
ListCount = Combo1.ListCount
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,List
Public Property Get List(ByVal index As Integer) As String
List = Combo1.List(index)
End Property
Public Property Let List(ByVal index As Integer, ByVal New_List As String)
Combo1.List(index) = New_List
PropertyChanged "List"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,NewIndex
Public Property Get NewIndex() As Integer
NewIndex = Combo1.NewIndex
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,SelLength
Public Property Get SelLength() As Long
'SelLength = Combo1.SelLength
End Property
Public Property Let SelLength(ByVal New_SelLength As Long)
Combo1.SelLength() = New_SelLength
PropertyChanged "SelLength"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,SelText
Public Property Get SelText() As String
'SelText = Combo1.SelText
End Property
Public Property Let SelText(ByVal New_SelText As String)
Combo1.SelText() = New_SelText
PropertyChanged "SelText"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,SelStart
Public Property Get SelStart() As Long
'SelStart = Combo1.SelStart
End Property
Public Property Let SelStart(ByVal New_SelStart As Long)
Combo1.SelStart() = New_SelStart
PropertyChanged "SelStart"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,Sorted
Public Property Get Sorted() As Boolean
Sorted = Combo1.Sorted
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,Style
Public Property Get Style() As ComboBoxConstants
Style = Combo1.Style
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Combo1,Combo1,-1,Text
Public Property Get Text() As String
Text = Combo1.Text
End Property
Public Property Let Text(ByVal New_Text As String)
Combo1.Text = New_Text
'PropertyChanged "Text"
End Property
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Dim index As Integer
Combo1.BackColor = PropBag.ReadProperty("BackColor", &H80000005)
Combo1.ForeColor = PropBag.ReadProperty("ForeColor", &H80000008)
Combo1.Enabled = PropBag.ReadProperty("Enabled", True)
Set Combo1.Font = PropBag.ReadProperty("Font", Ambient.Font)
UserControl.BackStyle = PropBag.ReadProperty("BackStyle", 1)
UserControl.BorderStyle = PropBag.ReadProperty("BorderStyle", 0)
Combo1.Appearance = PropBag.ReadProperty("Appearance", 1)
UserControl.DrawStyle = PropBag.ReadProperty("DrawStyle", 0)
'Combo1.FontSize = PropBag.ReadProperty("FontSize", 0)
'Combo1.FontName = PropBag.ReadProperty("FontName", "")
Combo1.FontItalic = PropBag.ReadProperty("FontItalic", 0)
Combo1.FontBold = PropBag.ReadProperty("FontBold", 0)
UserControl.FillStyle = PropBag.ReadProperty("FillStyle", 1)
UserControl.FillColor = PropBag.ReadProperty("FillColor", &H0&)
Combo1.FontUnderline = PropBag.ReadProperty("FontUnderline", 0)
UserControl.FontTransparent = PropBag.ReadProperty("FontTransparent", True)
Combo1.FontStrikethru = PropBag.ReadProperty("FontStrikethru", 0)
'TO DO: The member you have mapped to contains an array of data.
' You must supply the code to persist the array. A prototype
' line is shown next:
'Combo1.ItemData(Index) = PropBag.ReadProperty("ItemData" & Index, 0)
'Combo1.ListIndex = PropBag.ReadProperty("ListIndex", 0)
'TO DO: The member you have mapped to contains an array of data.
' You must supply the code to persist the array. A prototype
' line is shown next:
'Combo1.List(Index) = PropBag.ReadProperty("List" & Index, "")
' Combo1.SelLength = PropBag.ReadProperty("SelLength", 0)
'Combo1.SelText = PropBag.ReadProperty("SelText", "")
'Combo1.SelStart = PropBag.ReadProperty("SelStart", 0)
'Combo1.Text = PropBag.ReadProperty("Text", "Combo1")
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Dim index As Integer
Call PropBag.WriteProperty("BackColor", Combo1.BackColor, &H80000005)
Call PropBag.WriteProperty("ForeColor", Combo1.ForeColor, &H80000008)
Call PropBag.WriteProperty("Enabled", Combo1.Enabled, True)
Call PropBag.WriteProperty("Font", Combo1.Font, Ambient.Font)
Call PropBag.WriteProperty("BackStyle", UserControl.BackStyle, 1)
Call PropBag.WriteProperty("BorderStyle", UserControl.BorderStyle, 0)
Call PropBag.WriteProperty("Appearance", Combo1.Appearance, 1)
Call PropBag.WriteProperty("DrawStyle", UserControl.DrawStyle, 0)
Call PropBag.WriteProperty("FontSize", Combo1.FontSize, 0)
Call PropBag.WriteProperty("FontName", Combo1.FontName, "")
Call PropBag.WriteProperty("FontItalic", Combo1.FontItalic, 0)
Call PropBag.WriteProperty("FontBold", Combo1.FontBold, 0)
Call PropBag.WriteProperty("FillStyle", UserControl.FillStyle, 1)
Call PropBag.WriteProperty("FillColor", UserControl.FillColor, &H0&)
Call PropBag.WriteProperty("FontUnderline", Combo1.FontUnderline, 0)
Call PropBag.WriteProperty("FontTransparent", UserControl.FontTransparent, True)
Call PropBag.WriteProperty("FontStrikethru", Combo1.FontStrikethru, 0)
'TO DO: The member you have mapped to contains an array of data.
' You must supply the code to persist the array. A prototype
' line is shown next:
'Call PropBag.WriteProperty("ItemData" & Index, Combo1.ItemData(Index), 0)
Call PropBag.WriteProperty("ListIndex", Combo1.ListIndex, 0)
'TO DO: The member you have mapped to contains an array of data.
' You must supply the code to persist the array. A prototype
' line is shown next:
Call PropBag.WriteProperty("List" & index, Combo1.List(index), "")
'Call PropBag.WriteProperty("SelLength", Combo1.SelLength, 0)
'Call PropBag.WriteProperty("SelText", Combo1.SelText, "")
'Call PropBag.WriteProperty("SelStart", Combo1.SelStart, 0)
Call PropBag.WriteProperty("Text", Combo1.Text, "Combo1")
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?