c# - Embedded Form in a control or Form as User Control -
OK I have a large CRUD app that uses tabs with embedded form in them ->
Public Static Zero ShowFormInContainerControl (control ctl, form frm) {frm.TopLevel = false; Frm.FormBorderStyle = FormBorderStyle.None; Frm.Dock = DockStyle.Fill; Frm.Visible = true; Ctl.Controls.Add (frm); } Then I call in the form load form of the original form ->
// Embed this parent as child in WinFormCustomHandling .ShowFormInContainerControl ( PnlModuleHost, _frmWWCModuleHost); This was given to me in response to my previous question.
As I have made progress in it, I am feeling that many layers of embedded form are one and are waiting for disaster and user control should continue to pop up. Can anyone give me some solid advice on how to use user control versus embedding forms?
Thank you for this one for my inspiration
"Post-Text" itemprop = "text">
I will use a user control, think about it is simply simple, you can see what's going on in the designer (if you want) There is a bunch of luggage in the form, it is needed if you are going to use it as a view within your container.
Compare its method to its method:
Public static zero DockControl (Control Control, UserControl userControl) {UserControl.Dock = DockStyle.Fill; Control.Controls.Clear (); Control.Controls.Add (UserControl); }
Comments
Post a Comment