suite4.net.FormDatabase Documentation

LoaderForm.RootControl Property

Gets the Form or UserControl that has been set as the base control for modification by the LoaderForm's IForm.

[Visual Basic]
Public Property RootControl As Control
[C#]
public System.Windows.Forms.Control RootControl {get; set;}

Property Value

The default value of this property is NULL (Nothing in Visual Basic). It can only be set in the class constructor.

Remarks

The LoaderForm provides the possibility to modify the properties of an existing Form or UserControl instance by using an IForm. This works as follows:

  1. Using an appropriate constructor, the Form/UserControl and the IForm instances are loaded into the LoaderForm. They are assigned to the RootControl and MemberForm properties respectively.
  2. The LoaderForm inspects the RootControl and the MemberForm and looks for controls with the same name and type in both.
  3. In any controls that are found, the original property values of the controls in the RootControl are overwritten by those set in the MemberForm.
  4. The LoaderForm renders the result of the merge between the RootControl and the MemberForm.

Used this way, the IForm set in MemberForm acts as a kind of mask over the RootControl. Possible uses of this technique include showing/hiding of controls based on user roles, or localization of form labels for different user languages.

See Also

LoaderForm Class | suite4.net.FormDatabase Namespace