473,385 Members | 1,400 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,385 software developers and data experts.

sizing controls

hi
i am developing a c# app and i want that when i size the form the controls
should also be automatically sized.
thanx
Nov 15 '05 #1
2 1652
you will have to handle resize event of the form and make all your control sizes relative to your form size

e.g. button.Width = form1.Width/10
button.Height = form1.Height/10
so whenever you resize the form the controls resize inside the resize event handler of the for

----- ichor wrote: ----

h
i am developing a c# app and i want that when i size the form the control
should also be automatically sized
than

Nov 15 '05 #2
You can use the Dock and Anchors properties of the controls and the resize
event of the form.

For example if you have an edit box as large as the form, there is no need
to put the code to resize it in the Resize event, you only have to set the
Anchors properties to Left, Top, Right so the edit box will automatically
keep the distance from the Left, Top and Right borders of the form (and
automatically resize).

You can also play with the Dock property, try it and see what are the
effects.

HTH
Ciao
Formentz

"ichor" <al**@hotmail.com> ha scritto nel messaggio
news:ux**************@tk2msftngp13.phx.gbl...
hi
i am developing a c# app and i want that when i size the form the controls
should also be automatically sized.
thanx

Nov 15 '05 #3

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

Similar topics

53
by: Andrew Poulos | last post by:
I've got some CSS that looks like this: body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 140.01%; color: #000000; } but IE won't apply the font size to text in table...
0
by: Alexander Bolotnov | last post by:
Hi guys, here is another freaky thing that kind of bugs a lot. Maybe someone has ideas to this. We have a sort of a "dynamic" interface builder that will take a control schema and place the...
4
by: Tim Marsden | last post by:
Hi I would like to add controls to my page at runtime. What containers can I use to host the controls? I know I can add them to the form controls collection, but I need to have control on where...
9
by: Max | last post by:
Hello, Using VB.NET, I can activate an application by entering: AppActivate(intProcessID), where intProcessID is the process ID of a running application. Is it possible to set the size and...
2
by: Sean | last post by:
Is there a way to determine the size of the useable area of a tab control? I'm trying to create a Panel on the fly to place controls in (so it is scrollable), but the Tab Pages are all created on...
1
by: Alan M Dunsmuir | last post by:
I have a VB.NET Windows Forms application which uses as a splash screen a Form which I want to cover, exactly and entirely, with a specified ..jpg PictureBox. So I specified the Form, the...
4
by: kaosyeti | last post by:
what's the best way to get a form to always open at a specific size. i've sized and saved the forms, changed the borders and had popup on and off all over but can't seem to get it to stay one way...
5
by: lamxing | last post by:
Hi, I've come across a strange problem with the WinForm's sizing. I've designed a WinForm and it runs fine on my computer and some other PCs. But when I was trying to run the app under some PCs...
2
by: John B | last post by:
Hi all, I want to prevent the user being able to vertically size a control, in the same manner that single line textbox and autosize labels do. I can override SetBoundsCore which prevents the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.