Skip to content

Namespace CSharpLib.WinForms

Samuel edited this page May 16, 2021 · 1 revision

CSharpLib.WinForms contains two classes: Forms and FullScreen. Their usage is shown below.

Class CSharpLib.WinForms.Forms:

This class currently contains only one method: UpdateLabel. This method is for Windows Forms users who want a way to quickly update the text of a Windows Forms label. Use it like this:

using CSharpLib.WinForms;

Forms.UpdateLabel(Form form, Label label, string text);

In the above example, the method takes three parameters: the form containing the Label control, the design name of the label, and the text to show.

Added in version 3.0.0:

  • IsOutofBounds(Form form, Control control) - Checks if the specified control is, in part or in whole, out of the bounds of its parent form.

Class CSharpLib.WinForms.FullScreen:

This class changes your form to true fullscreen. Since this class is not static, initialize it:

using CSharpLib.WinForms;

FullScreen screen = new FullScreen();

To enter full screen mode, call EnterFullScreenMode():

screen.EnterFullScreenMode(Form targetForm);

screen.LeaveFullScreenMode(Form targetForm);

In the above example, the method takes the name of the form you want to fullscreen, sets the specified form to fullscreen, and returns it to its previous state by calling LeaveFullScreenMode().

WARNING: ONCE THE FORM IS FULLSCREEN, IT CANNOT BE CLOSED UNTIL LeaveFullScreenMode() IS CALLED.