Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

OnReadWdwState event

Project: Window State Components.

Unit: PJWdwState.

Class: TPJCustomWdwState

Applies to: ~>5.0

  TPJWdwStateReadEvent = procedure(
    Sender: TObject; var Left, Top, Width, Height, State: Integer
  ) of object;

property OnReadWdwState: TPJWdwStateReadEvent;


This event is triggered just after the window placement, size and state data is read from storage but before displaying the window. The data can be modified in the event handler before the window is displayed, enabling the size, placement and state of the window to be changed.

Setting any of the parameters to MaxInt causes the default value for the parameter to be used. These default values come from the relevant properties of the related form.

If Options property contains the woIgnoreState value then any changes to the State parameter in the event handler are ignored. Similarly if Options contains woIgnoreSize then changes to Width and Height are ignored and default values are used. Finally, if Options contains woFitWorkArea then the Top, Left, and (if woIgnoreSize is not specified) Width and Height values may be altered to ensure the window fits in the workspace.

The event is protected in TPJCustomWdwState. It may be exposed by derived components.