We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridBagLayout and Resizing

Thread ID:

Created:

Updated:

Platform:

Replies:

49029 Sep 8,2006 02:41 PM Sep 19,2006 04:05 PM Windows Forms 4
loading
Tags: Tools
Administrator [Syncfusion]
Asked On September 8, 2006 02:41 PM

Hello. I am attempting to create a form which uses the GridBagLayout control for the primary layout. I have two panels on the form, arranged in a 1 column by 2 row arrangement. The top panel contains a handful of textboxes which are additionally positioned by the FlowLayout control. The bottom panel contains a single textbox which is to resize as the panel resizes (both height and width).

I am able to successfully resize the form vertically and have it behave as desired (the top panel remains at a fixed height, and the bottom panel increases and decreases in height). I cannot identify the appropriate configuration to have the form behave as desired when modifying the width. In particular, as the form width is increased, the FlowLayout in the top panel enables the inputs to move into a side-by-side orientation. The FlowLayout also resizes the panel containing the controls (as evidenced by the border I displayed). Unfortunately, the second panel does not move to fill the space as the top panel is flattened, and I end up with a large gap between panels.

How do I need to configure the layout managers so that the panels fill all available space? Essentially, I want the bottom of the top panel and the top of the bottom panel to stay "glued" together, and as the top panel increases width and decreases height, I want the bottom panel to increase its height accordingly.

Can this scenario be implemented using the controls I''ve specified?

Thanks for any help you can give.

Mano J [Syncfusion]
Replied On September 11, 2006 09:04 PM

Hi John,

Our apologises for the delay in getting back to you.

We are working on a sample. I will update you within one day.

Thanks,
Mano

Purusothaman R [Syncfusion]
Replied On September 12, 2006 01:15 PM

Hi John,

I have created a sample, based on which I have understood the given scenario. Kindly refer to the Layout properties and Constraints of the Panels placed on the Form.

Let me know, whether this is what you need.

Thanks for using Syncfusion Products.

GridLayout.zip


Regards,
Purusothaman.R

Ramesh Praveen [Syncfusion]
Replied On September 12, 2006 04:15 PM

John,

Here is another try at implementing what you want (see attachment).

This version is much simpler. There is a flowlayout controling the child positions in the top panel. Then the top panel is docked to top and the bottom panel is docked to fill. That''s about it.

Let us know if this will work for you.

Regards,
Praveen Ramesh
Syncfusion




Layout_Modified_91206.zip

Administrator [Syncfusion]
Replied On September 19, 2006 04:05 PM

Praveen,

I believe that using the standard WinForms docking properties should be sufficient for my purposes. I originally wanted to be able to keep the bottom segment from sizing too small (through using the Layout Manager minimum size settings), but until I find otherwise, simplicity wins in this case.

I will implement the docking. Thanks for your assistance.

>John,

Here is another try at implementing what you want (see attachment).

This version is much simpler. There is a flowlayout controling the child positions in the top panel. Then the top panel is docked to top and the bottom panel is docked to fill. That''s about it.

Let us know if this will work for you.

Regards,
Praveen Ramesh
Syncfusion




Layout_Modified_91206.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;