OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Setting Gadget Size

The gadget's size is the size of the bounding rectangle of the gadget.

The size differs from the bounding rectangle in that it is independent of the position of the gadget. Thus, you can adjust the size of the gadget without changing the location of the gadget.

You can set the desired size of a gadget using the TGadget::SetSize function,

void SetSize(TSize& size);

Changing the gadget's size effectively moves the lower right corner of the bounding rectangle.

You can get use the TGadget::GetDesiredSize function to get the size the gadget would like to be:

virtual void GetDesiredSize(TSize& size);
Note
Because gadget windows can change the desired size of a gadget during the layout process, even if you have set the desired size of the gadget with SetSize, you should call GetDesiredSize to get the gadget's desired size.

See Also