check just Form4 , Form5 in this sourse file
Introduction
Adding New Properties to a Windows Form
-
In the Solution Explorer rightclick the project name and select Add, Add Windows Form from the context menu. Name the new form FormName
-
Right-click anywhere on the form and select View Code from the context menu. In the view, insert the following code just after the Windows Form Designer Generated Code region:
-
public enum State{Idle, Connecting, Processing}
private State formState;
[Browsable(true),
EditorBrowsable(EditorBrowsableState.Never),
Description("Sets the custom Form state"),
Category("Custom")]
public State FormState
{
get
{
return formState;
}
set
{
formState = value;
switch (formState)<FONT face=MacUSADigital-Regular size=1>
{
case State.Idle:
this.BackColor = Color.Red;
this.Text = "Idle";
break;
case State.Connecting:
this.BackColor = Color.Orange;
this.Text = "Connecting...";
break;
case State.Processing:
this.BackColor = Color.Green;
this.Text = "Processing";
break;
}
}
</FONT>}</FONT></FONT></FONT></FONT><FONT face=AGaramond-Regular size=3><FONT face=MacUSADigital-Regular size=1><FONT face=MacUSADigital-Regular size=1>
-
ATTRIBUTES THAT CONTROL THE BEHAVIOR OF A PROPERTY
-
Browsable Indicates whether the property is displayed in the Properties window. Its default value is true.
EditorBrowsable Indicates whether the property should appear in the
IntelliSense list of an object in the code view. Its value is of
the EditorBrowsableState enumeration type, with three
possible values—Advanced, Always, and Never. Its default
value is Always, which means “always list this property.” If
you change the value to Never, the property is hidden from
the IntelliSense feature.
Description Specifies a description string for the property. When the
Description property is specified, it is displayed in the
description area of the Properties window when the property
is selected.
Category Specifies the category of the property. The category is used in
the Properties window to categorize the property list.
-
In the Solution Explorer rightclick
-
the project name and select Add, Add Inherited
-
Form from the context menu. Name the new form
-
anyname make it inherted form the previous form
-
check the prperty window ... the custom category & the Formstate new property
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.