No Parent Properties?

C

Carl Johansson

In the Delphi VCL, most controls have Boolean "parent" properties, for
example ParentFont, ParentColor, ParentShowHint, and so on. This is a very
convenient way to determine whether the control should inherit the value for
those properties from its parent control.

This seems to work in C# too, that is, until I change, for example, the Font
property of a control. At that point, as far as I can tell, the "connection"
between the Font property of the control and the Font property of the form
is lost. How can it be restored?

Regards Carl Johansson
 
B

Bob Powell [MVP]

The system works such that if the control's Font is null, it looks to the
parent container for the information. You can go back to this by setting the
local font to null again.
At design time you can reset the value to it's default.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

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

Carl Johansson

Thank you for your reply! However, I'm not sure I get it!

The way I interpret your mail is that the relationship between the Font
property of the form and the Font property of the button only can be resumed
(at design time) by removing the statement that creates the Font object for
the button in the Form1.Designer.cs file. I.e., it is not possible to
accomplish this in a visual way?

Regards Carl Johansson
 

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

Top