Base Class Form Method Accessing Derived Forms Controls
I have a project that uses MANY dialogs. Each dialog performs much of the same code and business policies are an issue. For this reason I have created a method tha开发者_开发技巧t accesses the controls on the form.
foreach (Control control in this.Controls)
I need to access the controls on of the DERIVED Form, as these controls change. I want to do so by calling the base class method. Is this possible?
Many thanks in advance.
It seems you want to traverse the control structure of an extended class using a method declared in the super class?
Every container control on the page, and the page itself, has a Controls collection that you can use to get to individual controls.
This might give you the help you need C#, recursively notify child controls
精彩评论