Sub-forms

  • Thread starter Thread starter Joris Dobbelsteen
  • Start date Start date
J

Joris Dobbelsteen

Hi,

What is the best way to show a 'form' inside another form.
Or could I better use a user-control?

I currently don't want MDI, rather a wizard-style interface...

- Joris
 
Joris,

You shouldn't use a form inside another form. This use of the forms
isn't really supported (in windows anywhere, for that matter).

You should use a user-control and place that where you want in your
form.

Hope this helps.
 
Hi,

You cannot have a form inside another form AFAIK in that way, so you will
have to use a UserControl.

Now I remember that sometime ago somebody posted an announcement of Wizard
generator, or Wizard framework.
I dont have the link though :(

so you better check this NG in google or maybe somebody will post the link
here :)

Cheers,
 
My expectation,

Thanks...

- Joris

Nicholas Paldino said:
Joris,

You shouldn't use a form inside another form. This use of the forms
isn't really supported (in windows anywhere, for that matter).

You should use a user-control and place that where you want in your
form.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Joris Dobbelsteen said:
Hi,

What is the best way to show a 'form' inside another form.
Or could I better use a user-control?

I currently don't want MDI, rather a wizard-style interface...

- Joris
 
* "Joris Dobbelsteen said:
What is the best way to show a 'form' inside another form.
Or could I better use a user-control?

If you don't need a special border around the form and the form doesn't
need to be moveable, usercontrols are a good approach.
 
User control's can have borders, caption's, etc as well. When set Form's
TopLevel property to false actully what is done is to use WS_CHILD style for
the form. In other words it becomes control rather than form. So by
overriding CreateParams property and add all the WS_* styles for captions,
borders and so on any controls can behave in the same way as
form-inside-another-form does.
 
* "Stoitcho Goutsev \(100\) said:
User control's can have borders, caption's, etc as well. When set Form's
TopLevel property to false actully what is done is to use WS_CHILD style for
the form. In other words it becomes control rather than form. So by
overriding CreateParams property and add all the WS_* styles for captions,
borders and so on any controls can behave in the same way as
form-inside-another-form does.

OK, that would work.
 
Back
Top