Skip to content

Instantly share code, notes, and snippets.

@KevinRagsdale
Last active Dec 31, 2015
Embed
What would you like to do?
Subclassed Label control, used as my base label
DEFINE CLASS lbllabel AS label
AutoSize = .T.
FontName = "Segoe UI Symbol"
BackStyle = 0
Caption = "lblLabel"
Height = 17
Width = 43
Name = "lblLabel"
PROCEDURE OnClick
** Abstract method called by the Click() event
ENDPROC
PROCEDURE Click
This.OnClick()
ENDPROC
PROCEDURE Init
** On my Windows 8 machine, Segoe UI is not
** available in the Properties window, so I
** had to choose Segoe UI Symbol at design-
** time. We'll do the switch to Segoe UI
** here if the user is running Vista or later,
** and Tahoma if pre-Vista.
LOCAL ARRAY laFonts[1]
AFONT(laFonts)
IF ASCAN(laFonts,"Segoe UI") > 0 AND VAL(OS(3))>5
This.FontName = "Segoe UI"
This.FontSize = 9
ELSE
This.FontName = "Tahoma"
This.FontSize = 8
ENDIF
RELEASE laFonts
ENDPROC
ENDDEFINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment