Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,644 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,098 people online right now. Registration is fast and FREE... Join Now!




Permanent repaint of button at mouse click

 
Reply to this topicStart new topic

Permanent repaint of button at mouse click

Zeddicus
post 11 Oct, 2008 - 06:53 PM
Post #1


New D.I.C Head

*
Joined: 14 Jul, 2008
Posts: 41


My Contributions


If I want a button to be repainted permanently at the click of the same button, how can I do?

So far I have tried to send the button as sender after it has been clicked to the button's paint event. This only works to some extent, the repainting comes on but as soon as the mouse cursor leaves the button, the repainting wears off.

I am looking for a way to make the repainting stay on permanently.
User is offlineProfile CardPM

Go to the top of the page

kyrotomia
post 11 Oct, 2008 - 08:53 PM
Post #2


New D.I.C Head

*
Joined: 5 May, 2007
Posts: 45



Thanked 1 times
My Contributions


Hi there.

If I get your question right, here some tips about how you could do this :

First of all, since you want to change the color on the "click of a button", you need to write your code for the click event handler.

Secondly, I suggest you have a look at the "BackColor" property of your button. It would look like this :
CODE

this.btnChangeColor.BackColor = Color.DarkGray;


Hope it helps...
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 04:41AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month