C# Class Evbpc.Framework.Windows.Forms.Form

Represents a form (collection of Control objects) to be used for display in a project.
This class should not be directly inherited, as it is infrastructure for other, more graphics related, projects. You should, instead, inherit a form that is shipped with the related Graphics Library extension for your project. I spent a lot of time typing out this class. I just started typing and typing, and I didn't stop typing.
Inheritance: ContainerControl
Show file Open project: EBrown8534/Framework Class Usage Examples

Protected Properties

Property Type Description
Forms List

Private Properties

Property Type Description
IsInputChar bool
IsInputKey bool

Public Methods

Method Description
Activate ( ) : void

Activates the form and gives it focus.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.activate(v=vs.110).aspx

AddOwnedForm ( Form ownedForm ) : void

Adds an owned form to this form.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.addownedform(v=vs.110).aspx

Close ( ) : void

Closes the form.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.close(v=vs.110).aspx

FindForm ( string key ) : Form

Retrieves the Form with the specified Control.Name.

https://msdn.microsoft.com/en-us/library/system.windows.forms.control.findform(v=vs.110).aspx

Form ( ) : Evbpc.Framework.Drawing

Constructs a new instance of Form with default values.

RemoveOwnedForm ( Form ownedForm ) : void

Removes an owned form from this form.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.removeownedform(v=vs.110).aspx

SetDesktopBounds ( int x, int y, int width, int height ) : void

Sets the bounds of the form in desktop coordinates.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.setdesktopbounds(v=vs.110).aspx

SetDesktopLocation ( int x, int y ) : void

Sets the location of the form in desktop coordinates.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.setdesktoplocation(v=vs.110).aspx

Show ( ) : void

Calling this method will add the form for processing. Once a form has been shown, you should call Close to dispose of resources properly.

Due to the non-blocking nature of this method, once a form is shown the variable for it can go out of scope. This means that it will not be possible to close the form manually. It will also not be possible to make any changes to the form as well. The form will also not be disposed of, until it is closed by the user clicking the Close button, if one is made available. If you do not need to add controls, programmatically change anything on the form, or programmatically operate on it, then it is not necessary to hold on to the variable. You may still subscribe to events and will be informed when an event is triggered.

Protected Methods

Method Description
OnActivated ( EventArgs e ) : void

Raises the Activated event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onactivated(v=vs.110).aspx

OnClosed ( EventArgs e ) : void

Raises the Closed event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onclosed(v=vs.110).aspx

OnClosing ( CancelEventArgs e ) : void

Raises the Closing event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onclosing(v=vs.110).aspx

OnDeactivate ( EventArgs e ) : void

Raises the Deactivate event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.ondeactivate(v=vs.110).aspx

OnEnabledChanged ( EventArgs e ) : void

Raises the Control.EnabledChanged event.

https://msdn.microsoft.com/en-us/library/46w4szff(v=vs.110).aspx

OnEnter ( EventArgs e ) : void

Raises the Control.Enter event.

https://msdn.microsoft.com/en-us/library/46w4szff(v=vs.110).aspx

OnFormClosed ( FormClosedEventArgs e ) : void

Raises the FormClosed event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onformclosed(v=vs.110).aspx

OnFormClosing ( FormClosingEventArgs e ) : void

Raises the FormClosing event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onformclosing(v=vs.110).aspx

OnLoad ( EventArgs e ) : void

Raises the Load event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onload(v=vs.110).aspx

OnMaximizedBoundsChanged ( EventArgs e ) : void

Raises the MaximizedBoundsChanged event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onmaximizedboundschanged(v=vs.110).aspx

OnMaximumSizeChanged ( EventArgs e ) : void

Raises the MaximumSizeChanged event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onmaximumsizechanged(v=vs.110).aspx

OnMinimumSizeChanged ( EventArgs e ) : void

Raises the MinimumSizeChanged event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onminimumsizechanged(v=vs.110).aspx

OnResize ( EventArgs e ) : void

Raises the Control.Resize event.

https://msdn.microsoft.com/en-us/library/akxb9sb3(v=vs.110).aspx

OnResizeBegin ( EventArgs e ) : void

Raises the ResizeBegin event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onresizebegin(v=vs.110).aspx

OnResizeEnd ( EventArgs e ) : void

Raises the ResizeEnd event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onresizeend(v=vs.110).aspx

OnShown ( EventArgs e ) : void

Raises the Shown event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onshown(v=vs.110).aspx

OnTextChanged ( EventArgs e ) : void

Raises the Control.TextChanged event.

https://msdn.microsoft.com/en-us/library/ck6f88bf(v=vs.110).aspx

OnVisibleChanged ( EventArgs e ) : void

Raises the Control.VisibleChanged event.

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onvisiblechanged(v=vs.110).aspx

Select ( bool directed, bool forward ) : void

Selects this form, and optionally selects the next or previous control.

https://msdn.microsoft.com/en-us/library/sh071987(v=vs.110).aspx

Private Methods

Method Description
IsInputChar ( char charCode ) : bool
IsInputKey ( Keys keyData ) : bool

Method Details

Activate() public method

Activates the form and gives it focus.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.activate(v=vs.110).aspx
public Activate ( ) : void
return void

AddOwnedForm() public method

Adds an owned form to this form.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.addownedform(v=vs.110).aspx
public AddOwnedForm ( Form ownedForm ) : void
ownedForm Form The that this form will own.
return void

Close() public method

Closes the form.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.close(v=vs.110).aspx
public Close ( ) : void
return void

FindForm() public static method

Retrieves the Form with the specified Control.Name.
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.findform(v=vs.110).aspx
public static FindForm ( string key ) : Form
key string
return Form

Form() public method

Constructs a new instance of Form with default values.
public Form ( ) : Evbpc.Framework.Drawing
return Evbpc.Framework.Drawing

OnActivated() protected method

Raises the Activated event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onactivated(v=vs.110).aspx
protected OnActivated ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnClosed() protected method

Raises the Closed event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onclosed(v=vs.110).aspx
protected OnClosed ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnClosing() protected method

Raises the Closing event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onclosing(v=vs.110).aspx
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs A CancelEventArgs that contains the event data.
return void

OnDeactivate() protected method

Raises the Deactivate event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.ondeactivate(v=vs.110).aspx
protected OnDeactivate ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnEnabledChanged() protected method

Raises the Control.EnabledChanged event.
https://msdn.microsoft.com/en-us/library/46w4szff(v=vs.110).aspx
protected OnEnabledChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnEnter() protected method

Raises the Control.Enter event.
https://msdn.microsoft.com/en-us/library/46w4szff(v=vs.110).aspx
protected OnEnter ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnFormClosed() protected method

Raises the FormClosed event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onformclosed(v=vs.110).aspx
protected OnFormClosed ( FormClosedEventArgs e ) : void
e FormClosedEventArgs A that contains the event data.
return void

OnFormClosing() protected method

Raises the FormClosing event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onformclosing(v=vs.110).aspx
protected OnFormClosing ( FormClosingEventArgs e ) : void
e FormClosingEventArgs A that contains the event data.
return void

OnLoad() protected method

Raises the Load event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onload(v=vs.110).aspx
protected OnLoad ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnMaximizedBoundsChanged() protected method

Raises the MaximizedBoundsChanged event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onmaximizedboundschanged(v=vs.110).aspx
protected OnMaximizedBoundsChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnMaximumSizeChanged() protected method

Raises the MaximumSizeChanged event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onmaximumsizechanged(v=vs.110).aspx
protected OnMaximumSizeChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnMinimumSizeChanged() protected method

Raises the MinimumSizeChanged event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onminimumsizechanged(v=vs.110).aspx
protected OnMinimumSizeChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnResize() protected method

Raises the Control.Resize event.
https://msdn.microsoft.com/en-us/library/akxb9sb3(v=vs.110).aspx
protected OnResize ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnResizeBegin() protected method

Raises the ResizeBegin event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onresizebegin(v=vs.110).aspx
protected OnResizeBegin ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnResizeEnd() protected method

Raises the ResizeEnd event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onresizeend(v=vs.110).aspx
protected OnResizeEnd ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnShown() protected method

Raises the Shown event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onshown(v=vs.110).aspx
protected OnShown ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnTextChanged() protected method

Raises the Control.TextChanged event.
https://msdn.microsoft.com/en-us/library/ck6f88bf(v=vs.110).aspx
protected OnTextChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnVisibleChanged() protected method

Raises the Control.VisibleChanged event.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.onvisiblechanged(v=vs.110).aspx
protected OnVisibleChanged ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

RemoveOwnedForm() public method

Removes an owned form from this form.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.removeownedform(v=vs.110).aspx
public RemoveOwnedForm ( Form ownedForm ) : void
ownedForm Form A representing the form to remove from the list of owned forms for this form.
return void

Select() protected method

Selects this form, and optionally selects the next or previous control.
https://msdn.microsoft.com/en-us/library/sh071987(v=vs.110).aspx
protected Select ( bool directed, bool forward ) : void
directed bool If set to true that the active control is changed
forward bool If directed is true, then this controls the direction in which focus is moved. If this is true, then the next control is selected; otherwise, the previous control is selected.
return void

SetDesktopBounds() public method

Sets the bounds of the form in desktop coordinates.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.setdesktopbounds(v=vs.110).aspx
public SetDesktopBounds ( int x, int y, int width, int height ) : void
x int The x-coordinate of the form's .
y int The y-coordinate of the form's .
width int The width of the form.
height int The height of the form.
return void

SetDesktopLocation() public method

Sets the location of the form in desktop coordinates.
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.setdesktoplocation(v=vs.110).aspx
public SetDesktopLocation ( int x, int y ) : void
x int The x-coordinate of the form's .
y int The y-coordinate of the form's .
return void

Show() public method

Calling this method will add the form for processing. Once a form has been shown, you should call Close to dispose of resources properly.
Due to the non-blocking nature of this method, once a form is shown the variable for it can go out of scope. This means that it will not be possible to close the form manually. It will also not be possible to make any changes to the form as well. The form will also not be disposed of, until it is closed by the user clicking the Close button, if one is made available. If you do not need to add controls, programmatically change anything on the form, or programmatically operate on it, then it is not necessary to hold on to the variable. You may still subscribe to events and will be informed when an event is triggered.
public Show ( ) : void
return void

Property Details

Forms protected static property

A list of Form objects this Form owns.
protected static List Forms
return List