newbie: multiple panels in form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm writing an application that makes use of multiple panels (that contain
specific components), but shows only one to the user at a time (which one
depends on user interaction in a toolbar).
Now, as all panels have the same size and the same position in the form,
it's quite annoying to work with (esp. if you want to change a thing in the
'lowest' of the overlapping panels). so, as a newbie, I'd better ask if there
is any better way to handle this or a Visual Studio feature that makes life
easier?

Greetings,

Peter
 
I did the same as you, but I built each panel as a separate
UserControl, which means that I had a separate design surface for each.

I then placed all of the resulting UserControls on the Form. Since
that's the only thing I ever did with the form as a whole-placed new
UserControls on it-it was pretty easy to work with.
 
Peter said:
Hi,

I'm writing an application that makes use of multiple panels (that contain
specific components), but shows only one to the user at a time (which one
depends on user interaction in a toolbar).
Now, as all panels have the same size and the same position in the form,
it's quite annoying to work with (esp. if you want to change a thing in the
'lowest' of the overlapping panels). so, as a newbie, I'd better ask if there
is any better way to handle this or a Visual Studio feature that makes life
easier?

I think the best solution would be using user controls as Bruce suggested.
Another option is to place your panels side by side on the form, and
set their positions programmatically in the form constructor. I do the latter
when I have few small panels.
 
I agree with Bruce, who recommended making each panel a UserControl so
it can be worked on separately. But if you already have most of the UI
set up and you don't want to take the time to make the UserControls,
use this:

- Display the Document Outline panel (View > Other Windows > Document
Outline, or Ctrl+Alt+T).
- Click the name of the panel you want to work on. The "ghost" outline
of the panel appears on the design surface, with a 4-headed arrow icon
in the upper left corner.
- Right-click the arrow icon and choose "Bring to front". That makes
the selected panel and its controls visible.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Jay, does this work for WinForms, or only for WebForms? I didn't know
about this feature and tried it with one of my more complex forms (in
VS 2003) and it showed me nothing at all.
 
Bruce said:
Jay, does this work for WinForms, or only for WebForms? I didn't know
about this feature and tried it with one of my more complex forms (in
VS 2003) and it showed me nothing at all.

Looks like 'Document' here refers to DOM, so this is for WebForms only.
 
"Sericinus hunter" <[email protected]> kirjoitti
viestissä:USTXf.8526$%[email protected]...
Looks like 'Document' here refers to DOM, so this is for WebForms only.

Not really, even VS 2005 Express Editions have Document Outline feature.
Basically a tree structure of components in form, just looking here that as
Windows Forms app in C# and it sure is there- CTRL+W, U opens it, or View =>
Other windows => Document Outline.
 
Yeah, sorry. I only had VS 2003 installed for a few months before I
got 2005, so I didn't know Document Outline wasn't there.

Jay
 
Back
Top