473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2844
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.