Click here to Skip to main content
15,878,945 members
Articles / Desktop Programming / Windows Forms

XP Link Label (VB 2005)

Rate me:
Please Sign up or sign in to vote.
3.64/5 (20 votes)
4 Dec 2005CPOL1 min read 61.3K   254   45   11
A LinkLabel that mimics the ones in the task pane of Windows Explorer.

Introduction

This is my first attempt at making my own control. It mimics the LinkLabel that XP uses in the task pane on the left hand side of Explorer windows.

Screenshot of the real LinkLabels:

Sample image

The screenshot below shows the control at design time. As you can see, it has a "Smart Tag" with it, and the code also shows how to remove properties from the Properties panel that you don't want users to change.

Sample image

I know that you can probably just take a normal LinkLabel and add an image to it to make it look kind of like this, but I wanted to figure out how to add my own Smart Tags and display the real hand cursor when you hovered over it. The hand cursor that displays on this control is not the one that is built into VS. It's the real one from XP, with the shadow under it.

Take a look at it if you want and, by all means, leave me comments. I wasn't really sure how to do the drawing of the image and text, I was just winging it, so I'm sure there are better ways of doing it.

Update

I noticed that the mouse cursor was flickering when it left the control, and figured out that it was the following line:

VB
SetCursor(0)

If you have downloaded the demo, remove the above line for a smoother MouseLeave.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionWhat exactly? Pin
İsmail Durmaz25-Jan-06 14:46
İsmail Durmaz25-Jan-06 14:46 
AnswerRe: What exactly? Pin
marclile25-Jan-06 15:03
marclile25-Jan-06 15:03 
GeneralRe: What exactly? Pin
İsmail Durmaz27-Jan-06 18:58
İsmail Durmaz27-Jan-06 18:58 
GeneralReally Good Control Pin
Dennis Alexander Petrasch1-Jan-06 4:25
Dennis Alexander Petrasch1-Jan-06 4:25 
GeneralRe: Really Good Control Pin
Paul Conrad23-Jan-06 16:54
professionalPaul Conrad23-Jan-06 16:54 
Dennis Alexander Petrasch wrote:
This is a really good Control. Very useful.


Yes, indeed it is a very good control and useful.

Thank you for sharing with everyone on CP.

Paul
GeneralRe: Really Good Control Pin
marclile24-Jan-06 3:56
marclile24-Jan-06 3:56 
GeneralRe: Really Good Control Pin
Paul Conrad24-Jan-06 14:02
professionalPaul Conrad24-Jan-06 14:02 
QuestionExplorerBar Control? Pin
arhoads768-Dec-05 5:21
arhoads768-Dec-05 5:21 
AnswerRe: ExplorerBar Control? Pin
marclile8-Dec-05 17:39
marclile8-Dec-05 17:39 
GeneralRe: ExplorerBar Control? Pin
arhoads769-Dec-05 3:29
arhoads769-Dec-05 3:29 
GeneralRe: ExplorerBar Control? Pin
jklucker13-Dec-05 6:22
jklucker13-Dec-05 6:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.