How can I highlight an image when it is clicked and remove the highlight when the mouse is up?
+1
A:
Look at this highlight color on button click i think it deals with your problem
Pandiya Chendur
2010-03-27 07:05:19
Actually what I want is when image is clicked highlight it and not to change is background color.
C. Karunarathne
2010-03-27 13:07:25
@karuna any ex site...
Pandiya Chendur
2010-03-29 03:00:41
+1
A:
Why don't you go for CSS psuedo classes(:active,:hover), please take a look at this code.
<div class="rollover">
<a href="#"><img src="Jpeg/image.gif" /></a>
</div>
<style type="text/css">
<!--
.rollover a { display:block; width:32px; background-color: #FFFFFF}
.rollover a:hover { background-color: #990000}
.rollover a:active { background-color: #876787}
-->
</style>
Srinivas Reddy Thatiparthy
2010-03-27 08:04:16
+2
A:
Two steps:
- Capture Control.MouseDown Event
- Get the current color in OldColor
- Set the new color; and it would reflect the colored control.
- Something like
button1.BackColor = Color.Red;
- Capture the Control.MouseUp Event
- Set the OldColor
KMan
2010-03-27 09:51:01