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

Join 136,226 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,341 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
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
+Quote Post

kyrotomia
RE: Permanent Repaint Of Button At Mouse Click
11 Oct, 2008 - 08:53 PM
Post #2

D.I.C Head
**

Joined: 5 May, 2007
Posts: 50



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
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:04AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month