Use boxSizer.
When you add textCtrlyours to sizer, set the proportion 1and pass the flag wx.EXPAND, so yours textCtrlshould fill the panel, even when the panel is resized
bsizer = wx.BoxSizer()
bsizer.Add(yourTxtCtrl, 1, wx.EXPAND)
At the end of initializing your panels, place the following command to set the layout
self.SetSizerAndFit(bsizer)
source
share