📄 jcframes.ctl
字号:
PaintFrame
End Property
Public Property Get TextColor() As OLE_COLOR
TextColor = m_TextColor
End Property
Public Property Let TextBoxColor(ByRef new_TextBoxColor As OLE_COLOR)
m_TextBoxColorIni = TranslateColor(new_TextBoxColor)
PropertyChanged "TextBoxColor"
PaintFrame
End Property
Public Property Get TextBoxColor() As OLE_COLOR
TextBoxColor = m_TextBoxColorIni
End Property
Public Property Let BackColor(ByRef New_BackColor As OLE_COLOR)
m_BackColor = TranslateColor(New_BackColor)
UserControl.BackColor = m_BackColor
PropertyChanged "BackColor"
PaintFrame
End Property
Public Property Get BackColor() As OLE_COLOR
BackColor = m_BackColor
End Property
Public Property Set Font(ByRef New_Font As StdFont)
SetFont New_Font
PropertyChanged "Font"
PaintFrame
End Property
Public Property Let Font(ByRef New_Font As StdFont)
SetFont New_Font
PropertyChanged "Font"
PaintFrame
End Property
Public Property Get Font() As StdFont
Set Font = m_Font
End Property
Public Property Get Picture() As StdPicture
Set Picture = m_icon
End Property
Public Property Set Picture(ByVal New_Picture As StdPicture)
Set m_icon = New_Picture
PropertyChanged "Picture"
PaintFrame
End Property
Public Property Get IconSize() As Integer
IconSize = m_IconSize
End Property
Public Property Let IconSize(ByVal New_Value As Integer)
m_IconSize = New_Value
PropertyChanged "IconSize"
PaintFrame
End Property
Public Property Let IconAlignment(ByRef new_IconAlignment As IconAlignConst)
m_IconAlignment = new_IconAlignment
PropertyChanged "IconAlignment"
PaintFrame
End Property
Public Property Get IconAlignment() As IconAlignConst
IconAlignment = m_IconAlignment
End Property
Public Property Get ThemeColor() As jcThemeConst
ThemeColor = m_ThemeColor
End Property
Public Property Let ThemeColor(ByVal vData As jcThemeConst)
If m_ThemeColor <> vData Then
m_ThemeColor = vData
Call SetDefaultThemeColor(m_ThemeColor)
PaintFrame
PropertyChanged "ThemeColor"
End If
End Property
Public Property Get ColorFrom() As OLE_COLOR
Attribute ColorFrom.VB_Description = "Returns/Sets the Start color for gradient"
ColorFrom = m_ColorFrom
End Property
Public Property Let ColorFrom(ByRef new_ColorFrom As OLE_COLOR)
m_ColorFrom = TranslateColor(new_ColorFrom)
If m_ThemeColor = Custom Then jcColorFromIni = m_ColorFrom
PropertyChanged "ColorFrom"
PaintFrame
End Property
Public Property Get ColorTo() As OLE_COLOR
Attribute ColorTo.VB_Description = "Returns/Sets the End color for gradient"
ColorTo = m_ColorTo
End Property
Public Property Let ColorTo(ByRef new_ColorTo As OLE_COLOR)
m_ColorTo = TranslateColor(new_ColorTo)
If m_ThemeColor = Custom Then jcColorToIni = m_ColorTo
PropertyChanged "ColorTo"
PaintFrame
End Property
Public Property Let HeaderStyle(ByRef new_HeaderStyle As jcHeaderConst)
m_HeaderStyle = new_HeaderStyle
PropertyChanged "HeaderStyle"
PaintFrame
End Property
Public Property Get AtivarResizeDoForm() As Boolean
AtivarResizeDoForm = m_AtivarResizeDoForm
End Property
Public Property Let AtivarResizeDoForm(ByVal New_AtivarResizeDoForm As Boolean)
m_AtivarResizeDoForm = New_AtivarResizeDoForm
PropertyChanged "AtivarResizeDoForm"
End Property
Public Property Get MoverResponsavel() As jcResp
MoverResponsavel = m_Responsavel
End Property
Public Property Let MoverResponsavel(ByVal New_Responsavel As jcResp)
m_Responsavel = New_Responsavel
PropertyChanged "MoverResponsavel"
End Property
Public Property Get MoverControle() As Boolean
MoverControle = m_AllowDraging
End Property
Public Property Let MoverControle(ByVal New_AllowDraging As Boolean)
m_AllowDraging = New_AllowDraging
PropertyChanged "MoverControle"
End Property
Public Property Get MoverForm() As Boolean
MoverForm = m_AllowParentDraging
End Property
Public Property Let MoverForm(ByVal New_Drag As Boolean)
m_AllowParentDraging = New_Drag
PropertyChanged "MoverForm"
Call PaintFrame
End Property
'Faz o form aumentar e diminuir o seu tamanho (Collapsar)
Public Property Get Collapsar() As Boolean
Collapsar = m_Collapsar
End Property
Public Property Let Collapsar(ByVal New_Drag As Boolean)
Select Case m_style
Case Header, Panel, TextBox:
m_Collapsar = False
Case Else:
m_Collapsar = New_Drag
End Select
If m_Collapsar Then Label.Visible = True Else Label.Visible = False
PropertyChanged "Collapsar"
End Property
Public Property Get HeaderStyle() As jcHeaderConst
HeaderStyle = m_HeaderStyle
End Property
Public Property Let GradientHeaderStyle(ByRef new_GradientHeaderStyle As jcGradConst)
m_GradientHeaderStyle = new_GradientHeaderStyle
PropertyChanged "GradientHeaderStyle"
PaintFrame
End Property
Public Property Get GradientHeaderStyle() As jcGradConst
GradientHeaderStyle = m_GradientHeaderStyle
End Property
Private Sub SetjcTextDrawParams()
'Set text draw params using m_Alignment
If m_style = Panel Then
If m_Alignment = vbLeftJustify Then
jcTextDrawParams = DT_LEFT Or DT_WORDBREAK Or DT_VCENTER
ElseIf m_Alignment = vbRightJustify Then
jcTextDrawParams = DT_RIGHT Or DT_WORDBREAK Or DT_VCENTER
Else
jcTextDrawParams = DT_CENTER Or DT_WORDBREAK Or DT_VCENTER
End If
Else
If m_Alignment = vbLeftJustify Then
jcTextDrawParams = DT_LEFT Or DT_SINGLELINE Or DT_VCENTER
ElseIf m_Alignment = vbRightJustify Then
jcTextDrawParams = DT_RIGHT Or DT_SINGLELINE Or DT_VCENTER
Else
jcTextDrawParams = DT_CENTER Or DT_SINGLELINE Or DT_VCENTER
End If
End If
End Sub
Private Sub SetFont(ByRef New_Font As StdFont)
With m_Font
.Bold = New_Font.Bold
.Italic = New_Font.Italic
.Name = New_Font.Name
.Size = New_Font.Size
End With
Set UserControl.Font = m_Font
End Sub
'==========================================================================
' Functions and subroutines
'==========================================================================
Private Sub SetDefaultThemeColor(ThemeType As Long)
Select Case ThemeType
Case 0 '"Blue"
jcColorFromIni = RGB(129, 169, 226)
jcColorToIni = RGB(221, 236, 254)
jcColorBorderPicIni = RGB(0, 0, 128)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(0, 0, 0)
m_BackColor = RGB(192, 212, 240)
m_FillColorIni = RGB(192, 212, 240)
End If
Case 1 '"Silver"
jcColorFromIni = RGB(153, 151, 180)
jcColorToIni = RGB(244, 244, 251)
jcColorBorderPicIni = RGB(75, 75, 111)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(0, 0, 0)
m_BackColor = RGB(204, 203, 218)
m_FillColorIni = RGB(204, 203, 218)
End If
Case 2 '"Olive"
jcColorFromIni = RGB(181, 197, 143)
jcColorToIni = RGB(247, 249, 225)
jcColorBorderPicIni = RGB(63, 93, 56)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(0, 0, 0)
m_BackColor = RGB(224, 224, 213)
m_FillColorIni = RGB(224, 224, 213)
End If
Case 3 '"Visual2005"
jcColorFromIni = RGB(194, 194, 171)
jcColorToIni = RGB(248, 248, 242)
jcColorBorderPicIni = RGB(145, 145, 115)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(0, 0, 0)
m_BackColor = RGB(224, 224, 213)
m_FillColorIni = RGB(224, 224, 213)
End If
Case 4 '"Norton2004"
jcColorFromIni = RGB(217, 172, 1)
jcColorToIni = RGB(255, 239, 165)
jcColorBorderPicIni = RGB(117, 91, 30)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(0, 0, 0)
m_BackColor = RGB(236, 214, 128)
m_FillColorIni = RGB(236, 214, 128)
End If
Case 5 'Custom
jcColorFromIni = m_ColorFrom
jcColorToIni = m_ColorTo
jcColorBorderPicIni = m_FrameColor
Case 6
m_GradientHeaderStyle = VerticalGradient: m_HeaderStyle = Gradient
jcColorFromIni = RGB(137, 170, 224)
jcColorToIni = RGB(7, 33, 100)
jcColorBorderPicIni = RGB(100, 144, 88)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(215, 230, 251)
m_FillColorIni = RGB(142, 179, 231) '=
m_BackColor = RGB(142, 179, 231) '=
End If
Case 7 'xThemeGreen
m_GradientHeaderStyle = VerticalGradient: m_HeaderStyle = Gradient
jcColorFromIni = RGB(228, 235, 200)
jcColorToIni = RGB(175, 194, 142)
jcColorBorderPicIni = RGB(100, 144, 88)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(100, 144, 88)
m_FillColorIni = RGB(233, 244, 207) '=
m_BackColor = RGB(233, 244, 207) '=
End If
Case 8 'xThemeOffice2003Style2
m_GradientHeaderStyle = VerticalGradient: m_HeaderStyle = Gradient
jcColorFromIni = RGB(249, 249, 255)
jcColorToIni = RGB(159, 157, 185)
jcColorBorderPicIni = RGB(124, 124, 148)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(110, 109, 143)
m_FillColorIni = RGB(253, 250, 255) '=
m_BackColor = RGB(253, 250, 255) '=
End If
Case 9 'xThemeMetallic
m_GradientHeaderStyle = VerticalGradient: m_HeaderStyle = Gradient
jcColorFromIni = RGB(219, 220, 232)
jcColorToIni = RGB(149, 147, 177)
jcColorBorderPicIni = RGB(119, 118, 151)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(119, 118, 151)
m_FillColorIni = RGB(232, 232, 232) '=
m_BackColor = RGB(232, 232, 232) '=
End If
Case 10 'xThemeOrange
m_GradientHeaderStyle = VerticalGradient: m_HeaderStyle = Gradient
jcColorFromIni = RGB(255, 122, 0)
jcColorToIni = RGB(130, 0, 0)
jcColorBorderPicIni = RGB(139, 0, 0)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(255, 222, 173)
m_FillColorIni = RGB(255, 222, 173) '=
m_BackColor = RGB(255, 222, 173) '=
End If
Case 11 'xThemeTurquoise
m_GradientHeaderStyle = VerticalGradient: m_HeaderStyle = Gradient
jcColorFromIni = RGB(72, 209, 204)
jcColorToIni = RGB(43, 103, 109)
jcColorBorderPicIni = RGB(65, 131, 111)
If (Style = jcGradient) Or (Style = Messenger) Or (Style = Windows) Or (Style = TextBox) Then
m_TextColor = RGB(233, 250, 248)
m_FillColorIni = RGB(224, 255, 255) '=
m_BackColor = RGB(224, 255, 255) '=
End If
Case 12 'xThemeGray
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -