How: Layout Managers in .Net [Windows Forms] like Java?

  • Thread starter Mahesh Devjibhai Dhola [MVP]
  • Start date
M

Mahesh Devjibhai Dhola [MVP]

Hi,
How to achieve effect of LayoutManagers like java has Grid, Flow, Border etc
layouts in .Net?
The case is: I am creating the form runtime and adding controls on run-time
so at that time its very hactic to manipulate about other control's sizes,
positions etc so there must be easy way to do such things like what Java
LayoutManagers allow without worring the actual positions in pixels. It
allows me to add, insert etc operation without knowing other control's pixel
positions. I should be allowed to insert some control after some other
control by giving index or name directly which is not possible in Forms. Any
pointers please??

Microsoft is far ahead than Java in UI area then why these basic
functionalities are not there in APIs?

Help please,
 
H

Herfried K. Wagner [MVP]

Mahesh Devjibhai Dhola said:
How to achieve effect of LayoutManagers like java has Grid, Flow, Border
etc
layouts in .Net?
The case is: I am creating the form runtime and adding controls on
run-time
so at that time its very hactic to manipulate about other control's sizes,
positions etc so there must be easy way to do such things like what Java
LayoutManagers allow without worring the actual positions in pixels. It
allows me to add, insert etc operation without knowing other control's
pixel
positions. I should be allowed to insert some control after some other
control by giving index or name directly which is not possible in Forms.

If you are using .NET 2.0:

Check out the FlowLayoutPanel and TableLayoutPanel controls, which are
avialable on the "Containers" tab of VS 2005's toolbox.

..NET 1.0/1.1:

Simple Layout Managers
<URL:http://www.dotnet.jku.at/projects/slm/>
 
M

Mahesh Devjibhai Dhola [MVP]

Hi,
I know that VS2k5 has such APIs but i m sorry that i forgot to mention about
the .net version that in our production environment we are using vs2k3 so it
cant help.
Also, i have MSDN link for custom layout in windows forms in .net 1.1 but i
was interested to know that is there any built in mechanizm beyond Anchor,
and Dock that we can use directly so that we can avoid Positioning etc??

Thanks for the help,
 
T

tdavisjr

I have not came across any build in functionality in the .NET framework
1.1 that compares to layout managers like in java. Essentially,
controls are placed on the for by either using absolute positioning or
just by adding the control to the forms' controls collection. Anchoring
and Docking seems to be the only way to alter the layout and behavior
of form controls.

However, maybe there is some component that you can purchase that can
give you the affect that you want.
 
B

Bob Powell [MVP]

GotDotNet has some good articles by Chris Anderson on creating layout
managers.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
M

Mahesh Devjibhai Dhola [MVP]

Can you give me the link for GOTDOTNET?

Bob Powell said:
GotDotNet has some good articles by Chris Anderson on creating layout
managers.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

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