wyDay blog  |  Downloads  |  Buy
Support forum
wyDay blog
wyDay Home

The wyDay blog is where you find all the latest news and tips about our existing products and new products to come.

wyDay blog

Posts in the ‘linklabel2’ tag

I've updated the site to include an "Open Source" tab where you can find all the open source C# projects on wyDay:

I've also updated some of the controls. There is a new SplitButtonout with a few fixes pointed out in the comments. Also, the LinkLabel2 has been updated to correctly inherit the system link color and to allow for user set colors.

And of course the open source wyUpdate has been updated, but I won't turn this into another "BUY! BUY! BUY!" post for wyBuild.

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.

  1. The repulsive navy blue color reminds me of Netscape Navigator (anyone else remember the graceful Illegal Operation crashes?).
  2. There's no hover effect. OK, I lied. There's a hover effect but you have to code it. And if you do code it, you better put on your epilepsy goggles it's gonna flicker.
  3. The non-standard hand cursor is missing the shadow and the gradient.
  4. The LinkLabel font is oddly rendered:

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.

LinkLabel2 - How I fixed it

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)
if (m.Msg == 32)
//IDC_HAND == 32649
SetCursor(LoadCursor(0, 32649)); //the message has been handled
m.Result = IntPtr.Zero;
} base.WndProc(ref m);

But what about SysLink?

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.

Get it

It works with all the .NET 2.0 + languages (C#, VB.NET, etc.).

Download LinkLabel2 now

Also while you're at it download wyUpdate, or any of my other open source projects.

Go to the LinkLabel2 site for further updates.