Thanks for reply.Yes i want open up a new instance of a form inside a tabpage on a tab control when user clicks on Action.Meanwhile searching, i found solution so posting it here..
ManageCustomerProfileView frmProfile = new ManageCustomerProfileView(MyController); // creating form instance. constructor i changed as per my reqs.
frmProfile.TopLevel = false; // This is most Important
frmProfile.SetDisplay();// setting form display style - Custome method
frmProfile.FormBorderStyle = FormBorderStyle.None;
frmProfile.Width = this.uTbPageProfile.Width;
maxTabControl.Tabs["Profile"].Visible = true;
maxTabControl.Tabs["Profile"].Selected = true;
this.uTbPageProfile.Controls.Add(frmProfilde);
frmProfile.Show();
Above code adds my existing form inside Tabpage. i need to deal with added form events from main form as added form will act as control seems and not form i guess.
Thanks again.
Regards,
Maulik
|