Private def_backcolor As OLE_COLOR
Private def_caption As String
Private def_font As StdFont
Private def_forecolor As OLE_COLOR
Private def_selected As Boolean
Private color As Long
Private sel As Boolean
Private POINTS(15) As POINTAPI
Private Const leftcurve As Double = 0.5
Private Const rightcurve As Double = 0.3
Public Property Get BackColor() As OLE_COLOR
BackColor = color
End Property
Public Property Let BackColor(new_color As OLE_COLOR)
color = new_color
UserControl.BackColor = RndColor(TranslateColor(new_color))
UserControl.MaskColor = UserControl.BackColor
Refresh
End Property
Public Property Get Caption() As String
Caption = lblCaption.Caption
End Property
Public Property Let Caption(new_caption As String)
lblCaption.Caption = new_caption
Refresh
End Property
Public Property Get Font() As StdFont
Set Font = lblCaption.Font
End Property
Public Property Set Font(new_font As StdFont)
Set lblCaption.Font = new_font
Refresh
End Property
Public Property Get ForeColor() As OLE_COLOR
ForeColor = UserControl.ForeColor
End Property
Public Property Let ForeColor(new_color As OLE_COLOR)
UserControl.ForeColor = new_color
Refresh
End Property
Friend Property Get Selected() As Boolean
Selected = sel
End Property
Friend Property Let Selected(new_state As Boolean)
sel = new_state
Refresh
End Property
Private Sub UserControl_InitProperties()
def_backcolor = UserControl.BackColor
def_caption = ""
Set def_font = New StdFont
def_forecolor = UserControl.ForeColor
def_selected = False
'hdc = GetDC(UserControl.parent.hwnd)
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
PropBag.ReadProperty "BackColor", def_backcolor
PropBag.ReadProperty "Caption", def_caption
PropBag.ReadProperty "Font", def_font
PropBag.ReadProperty "ForeColor", def_forecolor
PropBag.ReadProperty "Selected", def_selected
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "BackColor", UserControl.BackColor, def_backcolor
PropBag.WriteProperty "Caption", lblCaption.Caption, def_caption
PropBag.WriteProperty "Font", lblCaption.Font, def_font
PropBag.WriteProperty "ForeColor", UserControl.ForeColor, def_forecolor
PropBag.WriteProperty "Selected", sel, def_selected
End Sub