how to resize a form put inside a tabpage and keep it in sinc with main form???
Posted on 2006-11-03
I have this tabcontrol that I put in my main form. It has three tabpages.
On the first tab I want to display a user form and I want to resize it so it matches that size on the tabcontrol. I also need to make sure the form follows the resize of the main form and the tabcontrol...
This is the code I use in the mainform's page load event to set up my user form:
private void frmMain_Load(object sender, EventArgs e)
Form1 frm= new Form1(); // the user form to display in tab #0
frm.TopLevel = false;
frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
frm.WindowState = FormWindowState.Normal;
Which event(s) do I need to redefine? and how to figure out the size on the form inside the tab relative to the main form and the tabcontrol?
I want everithing to be resized together, the mainform, the tabcontrol and the tabs...
thanks in advance