Link to home
Start Free TrialLog in
Avatar of carlajasminelewis
carlajasminelewis

asked on

Add mouseover underline and hand-cursor to custom web control

I am trying to modify a label control for a webform, to act as a psuedo-hyperlink.  I want to be able to click on it and it call functions from my code-behind.

Platinumbaby proposed this creative solution and it works very well for me:
https://www.experts-exchange.com/questions/21215296/Need-clickable-Label-control-on-webform.html#12641646

That question is closed and I would like to extend its functionality to include a mouseover that would underline the object's font and change the cursor to a hand.

Avatar of platinumbay
platinumbay

As I suggested, I would use CSS styles to do that.

Something similar to:
.text{font:10px verdana,helvetica,arial;text-decoration:none;cursor:pointer;}
a.text:link{font:10px verdana,helvetica,arial;text-decoration:none;color:#666699;cursor:hand;}
a.text:visited{font:10px verdana,helvetica,arial;text-decoration:none;color:#333366;cursor:hand;}
a.text:hover{font:10px verdana,helvetica,arial;text-decoration:underline;color:#666699;cursor:hand}

However, you could programtically add those styles to the CustomWebControl.  I'll have some code for that shortly.
Avatar of carlajasminelewis

ASKER

Great...I can't wait (seriously) :-)
ASKER CERTIFIED SOLUTION
Avatar of platinumbay
platinumbay

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You're the bomb; and your code it straightforward enough that I actually learned something.  Thanks for your effort!
Knowing how to use WebCustomControls is a very cool thing, you can do a lot to extend the base controls, and they have been lifesends for me in the past.  Glad I could help, and glad you learned something.