How do I set the size of a multi-line TextCtrl to always fill its parent panel?
Use a boxSizer
.
When you add your textCtrl
to the sizer set the proportion to 1
and pass the wx.EXPAND
flag, that way your textCtrl
should fill the panel even when the panel is resized
bsizer = wx.BoxSizer()
bsizer.Add(yourTxtCtrl, 1, wx.EXPAND)
Put the following at the end of your panels initialization to set the layout
self.SetSizerAndFit(bsizer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With