473,473 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Auto resize and position controls upon form's Resize even


Hi,
Are there any cool controls that would allow me to automatically resize
and repositions controls on my form when the form is resized at runtime?

Thanks in advance.
Mar 30 '06 #1
3 4134
Look at the Dock and Anchor properties of your controls. They work in
..NET 1.1 and .NET 2.0.

In .NET 2.0 there are layout panels. Check out the Layout section of
the System.Windows.Forms namespace in .NET 2.0:

http://windowssdk.msdn.microsoft.com...dows_Forms.asp

Mar 30 '06 #2
Check the screen size when the application starts and based on the original
designed screen size, you can ratio the vertical and horizontals. Loop thru
all the controls and resize and relocate those that have the dock property
set to none.
--
Dennis in Houston
"Bruce Wood" wrote:
Look at the Dock and Anchor properties of your controls. They work in
..NET 1.1 and .NET 2.0.

In .NET 2.0 there are layout panels. Check out the Layout section of
the System.Windows.Forms namespace in .NET 2.0:

http://windowssdk.msdn.microsoft.com...dows_Forms.asp

Mar 31 '06 #3
Yes, that's the painful way to do it.

The first line of attack should be Dock and Anchor. In .NET 2.0 these
can be used in concert with layout containers like FlowLayoutPanel,
TableLayoutPanel, and SplitContainer.

If you cannot get the effect you want with a combination of these
things, then you have two choices, depending upon the situation:

1) Create your own layout container that does what you want. Lots of
work, but at least you can use it over and over in other projects.

2) Handle the Resize event on the Form and move and reshape your
controls accordingly.

If you have to resort to #2 in .NET 1.1 then that's life. If you have
to resort to #2 in .NET 2.0 then you really have to ask yourself if
it's worth getting that specific effect you're after (hint: it probably
isn't).

Mar 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jesse.hartwick | last post by:
Hi all. I'm designing a program that has to run on multiple resolutions and I'm having trouble with moving contols on the form. The way I have it now, the form is maximized on load, and the...
3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
3
by: Wayne | last post by:
1. I have created my own class that inherits the textbox (called it CyanFocusTextBox). I put in some code and some new properties. All this works. I build the dll that contains this class...
2
by: Kevin L | last post by:
How would I go about resizing a panel control using a mouse at runtime?
0
by: 23s | last post by:
Is there any way I can send a vertical value to a form's scroll position? I have a full-screen form that, at launch, contains an empty tab sheet. At run time, the user can dynamically append a...
2
by: Jason | last post by:
Hello I've created a form that serves as a front end for a DB. My question is how to resize the form, and have the control on the form resize themselves as i drag the form. I've got a status...
4
by: helpful sql | last post by:
Hi, Are there any cool controls that would allow me to automatically resize and repositions controls on my form when the form is resized at runtime? Thanks in advance.
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
4
by: michael sorens | last post by:
In a Windows Form application, when a user resizes the window, I typically want different components in the form to take different actions. For example, a text box in the middle should grow...
0
by: =?Utf-8?B?VmljdG9y?= | last post by:
Hi, I have a problem with the Form Editor VS2008 in a C# Windows application. Form Editor seems to change size of some controls to an arbitrary large values by its own will. I position,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.