Click here to Skip to main content
Licence CPOL
First Posted 4 Dec 2005
Views 39,568
Downloads 80
Bookmarked 44 times

XP Link Label (VB 2005)

By | 4 Dec 2005 | Article
A LinkLabel that mimics the ones in the task pane of Windows Explorer.
Prize winner in Competition "VB.NET Nov 2005"

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:

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)

About the Author

marclile



United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionWhat exactly? Pinmemberismaildurmaz14:46 25 Jan '06  
AnswerRe: What exactly? Pinmembermarclile15:03 25 Jan '06  
GeneralRe: What exactly? Pinmemberdungeonsdarknight18:58 27 Jan '06  
GeneralReally Good Control PinmemberDennis Alexander Petrasch4:25 1 Jan '06  
GeneralRe: Really Good Control Pinmembercomputerguru9238216:54 23 Jan '06  
GeneralRe: Really Good Control Pinmembermarclile3:56 24 Jan '06  
GeneralRe: Really Good Control Pinmembercomputerguru9238214:02 24 Jan '06  
QuestionExplorerBar Control? Pinmemberarhoads765:21 8 Dec '05  
AnswerRe: ExplorerBar Control? Pinmembermarclile17:39 8 Dec '05  
GeneralRe: ExplorerBar Control? Pinmemberarhoads763:29 9 Dec '05  
GeneralRe: ExplorerBar Control? Pinmemberjklucker6:22 13 Dec '05  

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

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 4 Dec 2005
Article Copyright 2005 by marclile
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid