Subclassed Label control, used as my base label
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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