Establishes the resize limits of a window.

Syntax

SRP_Set_MinMaxInfo(Window, MinSize, MaxSize, MaximizedSize)

Parameters

Title FieldDescription
WindowThe fully qualified name of the window whose resize behavior to modify
MinSizeThe minimum tracking size of the window
MaxSizeThe maximum tracking size of the window
MaximizedSizeThe size and position of the window when maximized

Remarks

Call this method during the create event of your window to limit the resizing behavior. Simply pass the fully qualified name of the Window whose size you wish to control. The remaining parameters are described in more detail below.

MinSize

This parameter establishes the minimum tracking size of a window. When the user attempts to resize the window by dragging the mouse, you can rest assured that your window will be no smaller than the size specified in this parameter. The parameter has two fields:

FieldNameDescription
<1>Minimum WidthThe window will never become smaller than this width
<2>Minimum HeightThe window will never become smaller than this height

Additionally, specify "DEF" if you wish to set the minimum size to the window's current size or "" if you do not want a minimum size for your window.

MaxSize

This parameter establishes the maximum tracking size of a window. When the user attempts to resize the window by dragging the mouse, you can rest assured that your window will be no larger than the size specified in this parameter. The parameter has two fields:

FieldNameDescription
<1>Maximum WidthThe window will never become larger than this width
<2>Maximum HeightThe window will never become larger than this height

Additionally, specify "DEF" if you wish to set the maximum size to the window's current size or "" if you do not want a maximum size for your window.

MaximizedSize

This parameter establishes the size and position of the window when the user clicks the maximize button. Normally, maximizing a window causes it to fill the entire workspace, but you can alter that behavior with this parameter. The parameter has two fields:

FieldNameDescription
<1>Maximized X PositionThe window will move to this X position when maximized
<2>Maximized Y PositionThe window will move to this Y position when maximized
<3>Maximized WidthThe window will use this width when maximized
<4>Maximized HeightThe window will use this height when maximized

Additionally, specify "DEF" if you wish to set the maximized size and position to the window's current size and position or "" if you do want to use the system's standard maximize settings for your window.

If you specify a maximized size smaller than the screen, note that while the user cannot resize the window, he/she can still move the window using its title bar.

Examples

* Set the window’s minimum size to its current size
SRP_Set_MinMaxInfo(@Window, "DEF")

* Set the window’s maximum size to its current size
SRP_Set_MinMaxInfo(@Window, "", "DEF") 

* Make the window non-resizable and non-maximize-able
SRP_Set_MinMaxInfo(@Window, "DEF", "DEF", "DEF")

* Set explicit limits on the windows tracking size
SRP_Set_MinMaxInfo(@Window, 100:@FM:100, 500:@FM:500)

* Make the window maximize to an explicit size and position
SRP_Set_MinMaxInfo(@Window, "", "", 100:@FM:100:@FM:500:@FM:500)
  • No labels