The wyDay blog is where you find all the latest news and tips about our existing products and new products to come.
If you've done any Windows Forms designing then you've undoubtedly used the LinkLabel control. You've also likely noticed its hideous look:
The ugliness of the LinkLabel that ships with Windows Forms is four fold.
The Windows.Forms LinkLabel looks as though the text was drawn to the screen once, then drawn again without erasing the first copy. This gives the LinkLabel a jagged, blocky look.
It was a simple bit of code. I used 'TextRenderer.DrawText(...)' to do the actual drawing. The hand cursor was simply a matter of intercepting the WM_SETCURSOR message to my LinkLabel2 control:
public static extern int LoadCursor(int hInstance, int lpCursorName); [DllImport("user32.dll")]
public static extern int SetCursor(int hCursor); protected override void WndProc(ref Message m)
//WM_SETCURSOR == 32
if (m.Msg == 32)
//IDC_HAND == 32649
SetCursor(LoadCursor(0, 32649)); //the message has been handled
m.Result = IntPtr.Zero;
} base.WndProc(ref m);
SysLink is a link control added to ComCtl32.dll in Windows XP. So, why not use SysLink? Because SysLink doesn't exist in Windows 2000/98.
Maybe in 3 years, when Windows 2000 is dead, a simple SysLink wrapper for C# can be written.
It works with all the .NET 2.0 + languages (C#, VB.NET, etc.).
Go to the LinkLabel2 site for further updates.
Subscribe to our blog's RSS Feed or follow Wyatt (CEO of wyDay) on Mastodon (@email@example.com) to keep up-to-date with our latest posts.