RectangleExtensionsEnsureScreen Method
Adjusts the specified rectangle to ensure it is positioned within the given screen's working area.
Namespace: KGySoft.WinFormsAssembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
public static Rectangle EnsureScreen(
this Rectangle suggestedBounds,
Screen screen,
bool forceSingleScreen
)
<ExtensionAttribute>
Public Shared Function EnsureScreen (
suggestedBounds As Rectangle,
screen As Screen,
forceSingleScreen As Boolean
) As Rectangle
public:
[ExtensionAttribute]
static Rectangle EnsureScreen(
Rectangle suggestedBounds,
Screen^ screen,
bool forceSingleScreen
)
[<ExtensionAttribute>]
static member EnsureScreen :
suggestedBounds : Rectangle *
screen : Screen *
forceSingleScreen : bool -> Rectangle
- suggestedBounds Rectangle
- The initial rectangle bounds to be adjusted.
- screen Screen
- The screen within which the rectangle should be positioned.
- forceSingleScreen Boolean
- to ensure the rectangle is entirely contained within the specified screen if possible;
to ensure that the largest part of the rectangle is on the specified screen.
RectangleThe adjusted
Rectangle.In Visual Basic and C#, you can call this method as an instance method on any object of type
Rectangle. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).