How to draw a control as selected?

How to draw a control as selected?

Post by Tom Tempel » Sun, 08 May 2005 21:43:14


Hi,

What would I have to do to draw my custom control to appear selected?

Thank you,
Tom T.
 
 
 

How to draw a control as selected?

Post by Bob Powell » Mon, 09 May 2005 01:51:13

Is this at runtime or design time?

I suppose at runtime the style would be up to you. You'd obviously paint the
control differently if it had the focus or not.

Ad design time the IDE should do most of the work fo you but you might also
wish to look at the designers PaintAdornments method.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.yqcomputer.com/

Answer those GDI+ questions with the GDI+ FAQ
http://www.yqcomputer.com/

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"TT (Tom Tempelaere)" </\/_0_$P@/\/\titi____AThotmailD.Tcom/\/\@P$_0_/\/>

 
 
 

How to draw a control as selected?

Post by Herfried K » Mon, 09 May 2005 02:08:59

"TT (Tom Tempelaere)" </\/_0_$P@/\/\titi____AThotmailD.Tcom/\/\@P$_0_/\/>
schrieb:

Take a look at 'ControlPaint', it provides several methods to draw controls
in a selected mode (focus rectangles, etc.).

--
M S Herfried K. Wagner
M V P <URL: http://www.yqcomputer.com/ ;
V B <URL: http://www.yqcomputer.com/ ;
 
 
 

How to draw a control as selected?

Post by Tom Tempel » Mon, 09 May 2005 05:57:36

Hi Herfried,

"Herfried K. Wagner [MVP]" < XXXX@XXXXX.COM > schreef in bericht


Actually, the control paints things and I would like it to have the effect
as though an icon or bitmap was selected, sort of a blueish shine.

Thanks,
Tom T.