What is ForeColor For??

  • Thread starter Thread starter **Developer**
  • Start date Start date
D

**Developer**

Both the UserControl and the PictureBox has a ForeColor Property.

I've set them to odd colors so I'd see the effects but they don't show.



What are the used for?



Thanks in advance
 
**Developer** said:
Both the UserControl and the PictureBox has a ForeColor Property.

I've set them to odd colors so I'd see the effects but they don't show.



What are the used for?



Thanks in advance

Forecolor gets inherited from Control. So everything that inherits from
Control will have that property. Weither or not the control uses the
property is up to the implementation.

Chris
 
**Developer** said:
Both the UserControl and the PictureBox has a ForeColor Property.

I've set them to odd colors so I'd see the effects but they don't show.

'ForeColor' is typically used to control the color of the text drawn onto
the control. You can use this property's value when drawing text onto
usercontrols or panels. The property gets inherited from the
'System.Windows.Forms.Control' class.
 
Seems to me that for a usercontrol and for PictureBox I have to specify a
pen or a brush to write on it.

So ForeColor is never used unless I add a procedure that uses it. Right?

Thanks.
 
When you use a pen or brush to write/draw on a usercontrol, you can set the
pen or brush to the control's forecolor. This gives users of your control a
way to control the color of the writing or drawing.
 
Thanks

Dennis said:
When you use a pen or brush to write/draw on a usercontrol, you can set
the
pen or brush to the control's forecolor. This gives users of your control
a
way to control the color of the writing or drawing.
 

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

Back
Top