Artem Zh.
Artem Zh.

Reputation: 528

How to set a minimum wxPanel size for user resizing in wxWidgets?

How to set borders size below which the user cannot resize the wxPanel?

Upvotes: 0

Views: 676

Answers (1)

VZ.
VZ.

Reputation: 22688

The user can never resize a panel directly, so what you need to do is to prevent them from resizing the top level window (i.e. usually a wxFrame) below the minimum size and this can be done either using SetSizeHints() or, simpler, using SetMinSize().

If you use sizers for the layout, then you can also use them to compute this minimum size which is the same thing as "best size", i.e. basically all you need to do is to call SetMinSize(GetBestSize()) after setting up your layout.

Upvotes: 1

Related Questions