Windows Forms Layout Options - Explorer style

Y

Yuk Tang

I'm trying to create webpage-style frames on a form, and all the get
parent size and resize children malarkey is giving me a headache. What
I would like to do is define some frames on the parent forms, then load
the children into those frames, maximised (to fill the frame). SDK has
an intriguing section titled "Windows Forms Layout Options", but it
doesn't actually say how.

From browsing google archives, it seems that this is a fairly simple
and widely known matter. Is there an online tutorial for this, or can
anyone explain it here?
 
C

Cerebrus

Hi Yuk Tang,

Use Panels and Splitter controls, and set docking and anchor properties
as necessary

I think there is a walkthrough in MSDN for this... (Walkthrough:
Creating a Multipane User Interface with Windows Forms) at
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbtskCreatingIntricateUserInterfaceWithWindowsApplicationObjects.htm

It's pretty detailed and should clear your concepts...

If it is still unclear, I will post exact steps to make an Windows
explorer like interface.

Regards,

Cerebrus.
 
Y

Yuk Tang

Cerebrus said:
Hi Yuk Tang,

Use Panels and Splitter controls, and set docking and anchor
properties as necessary

I think there is a walkthrough in MSDN for this... (Walkthrough:
Creating a Multipane User Interface with Windows Forms) at
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbtskCreatingIntricateUserIn
terfaceWithWindowsApplicationObjects.htm

It's pretty detailed and should clear your concepts...

If it is still unclear, I will post exact steps to make an Windows
explorer like interface.

Yes please. Perhaps I have a different edition of MSDN, but your
link doesn't bring anything up in SDK, and googling by those keywords
doesn't find anything either.

I've added two panels, got coordinates for them, set their locations
and sizes using lefts, tops, widths and heights (is there a neater
way?). Now I'm looking to contain a form inside a panel. As for
splitters, I have no idea how they work (MSDN isn't too helpful
either).

I'm starting to think that MSDN is great for code, not so good for
explaining ideas.
 
H

Homer J Simpson

Thanks for that. I'll give it a try tonight.

A manual method.

Start a new project.
Add a ToolStripContainer
Set it to dock to the form (Fill)
Click in the top section.
Add a menu strip
Add a tool strip.
Add another tool strip.
Click in the bottom section.
Add a StatusStrip.
Click in the ToolStripContainer panel.
Add a TreeView.
Set Dock to Left.
Add a Splitter.
Add a Panel.
Set Dock to Fill.
Add a ListView.
Set Dock to Top.
Add a Splitter.
Set Dock to Top.
Add a RichTextBox.
Set Dock to Fill.

File: Export Template to use this as a template for next time!
 
C

Cerebrus

Hi Yuk Tang,

Are you using VS 2003 or 2005 ?? I'm sorry, you had trouble finding the
article in the MSDN help. I should've posted the link to the online
library too, but I had this one stored in my favourites...

Anyway, Homer has supplied that (and the steps too !), so I hope that
you found the information that you needed.

Regards,

Cerebrus.
 
Y

Yuk Tang

Cerebrus said:
Hi Yuk Tang,

Are you using VS 2003 or 2005 ?? I'm sorry, you had trouble
finding the article in the MSDN help. I should've posted the link
to the online library too, but I had this one stored in my
favourites...

Thanks for the information. I've experimented with it now, and have
(I think) got the hang of panels, splitters and the People's Front of
Judaea. However, I've found other problems.

Btw, I'm using VS 2003, which was (is?) probably still the problem.
Most of my experience is with a much older version of VB, so it's
been a fair leap to make. However, I'm liking the logic of OOP more
the more I try it. Still having to adjust to not having existing
forms and other object collections though.

Anyway, Homer has supplied that (and the steps too !), so I hope
that you found the information that you needed.

A clearer idea of what I'm looking at plus the collected wisdom of
the appropriate newsgroup is working wonders. I just hope I'm able
to learn enough to pass on any ideas in turn. Are frequent questions
frowned upon in this group?
 
H

Homer J Simpson

A clearer idea of what I'm looking at plus the collected wisdom of
the appropriate newsgroup is working wonders. I just hope I'm able
to learn enough to pass on any ideas in turn. Are frequent questions
frowned upon in this group?

Only "Is your X/Y/Z too small?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top