Changing the color of cell on mouse over event in calendar control

G

Garg

Hi,

I want to make the color of a cell change in my calendar control,
whenever mouse is brought over that particular cell. How can I achieve
this functionality??

Thanks,
Shivani
 
M

marss

Garg said:
Hi,

I want to make the color of a cell change in my calendar control,
whenever mouse is brought over that particular cell. How can I achieve
this functionality??

Thanks,
Shivani

Here the example:
cell.Attributes["onmouseover"] =
"this.style.backgroundColor='#ff0000';";
cell.Attributes["onmouseout"] =
"this.style.backgroundColor='#0000ff';";

Or if existing background color of the cell is set by the style sheet
or it is inherited from parent element:
cell.Attributes["onmouseover"] =
"this.oldBGColor=this.style.backgroundColor;this.style.backgroundColor='#ff0000';";
cell.Attributes["onmouseout"] =
"this.style.backgroundColor=this.oldBGColor;";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top