Last active
April 25, 2019 01:09
-
-
Save KevinRagsdale/8008085 to your computer and use it in GitHub Desktop.
https://kevinragsdale.github.io/a-hyperlink-class-subclassing-the-label-control/ lblHyperlink subclass of lblLabel, requires the lblLabel source, available at https://gist.github.com/KevinRagsdale/7976364
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 lblHyperlink AS lblLabel | |
MousePointer = 15 | |
ForeColor = RGB(0,102,204) | |
nForeColor = 0 | |
nHoverColor = 0 | |
Name = "lblhyperlink" | |
PROCEDURE Init | |
DODEFAULT() | |
** Use GetSysColor to get the hyperlink color | |
DECLARE INTEGER GetSysColor IN "user32" INTEGER nIndex | |
This.nForeColor = GetSysColor(26) && COLOR_HOTLIGHT | |
This.nHoverColor = GetSysColor(29) && MENU_HOTLIGHT | |
ENDPROC | |
PROCEDURE MouseEnter | |
LPARAMETERS nButton, nShift, nXCoord, nYCoord | |
WITH THIS | |
.ForeColor = .nHoverColor | |
.FontUnderline = .T. | |
.Caption = .Caption | |
ENDWITH | |
ENDPROC | |
PROCEDURE MouseLeave | |
LPARAMETERS nButton, nShift, nXCoord, nYCoord | |
WITH THIS | |
.ForeColor = .nForeColor | |
.FontUnderline = .F. | |
.Caption = .Caption | |
ENDWITH | |
ENDPROC | |
ENDDEFINE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment