You can specify the layout direction when creating the Wx. boxsizer object:
Hbox = wx. boxsizer (wx. Horizontal) is set to horizontal
Hbox = wx. boxsizer () is horizontal by default.
Vbox = wx. boxsizer () sets the vertical direction
To add a child window or control to the parent window, you must call wx. the add () method of the boxsizer object. The add () method is from the parent class wx. the add () method syntax inherited by sizer is described as follows:
Add (Windows, proportion = 0, flag = 0, border = 0, userdata = none) to the parent window
Add (sizer, proportion = 0, flag = 0, border = 0, userdata = none) to another sizer for nesting
Add (width, height, porprotion = 0, flag = 0, border = 0, userdata = none) to add a blank control
| Wx. allgn_top |
Top alignment |
| Wx. allgn_bottom |
Bottom alignment |
| Wx. allgn_left |
Left aligned |
| Wx. allgn_right |
Right alignment |
| Wx. allgn_center |
Center alignment |
| Wx. allgn_center_vertical |
Vertical center alignment |
| Wx. allgn_center_horizontal |
Align horizontally |
| Wx. allgn_centre |
The same as wx. allgn_center |
| Wx. allgn_centre_vertical |
The same as wx. allgn_center_vertical. |
| Wx. allgn_centre_horizontal |
The same as wx. allgn_center_horizontal. |
| Wx. Top |
Set a border on the top. The Border Width needs to be set through the border of the add () method. |
| Wx. Bottom |
Set a border at the bottom |
| Wx. Left |
Set a left border |
| Wx. Right |
Set the right border |
| Wx. All |
Set a border with Four Sides |
| Wx. Expand |
Adjust sub-windows or controls to fill up valid space completely |
| Wx. Shaped |
Adjust the sub-window or control to fill up the valid space, but retain the aspect ratio |
| Wx. fixed_minsize |
Adjust the child window or widget to the minimum size |
| Wx. reserve_space_event_hi_hidded |
After this flag is set, if the child window or control is hidden, the occupied space is retained. |
Box layout management