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

form resizing

Hello,

Ive got a form with 3 textboxes - one under the other. When I set the anchor
to top, left, right, and bottom for each of them and resize the form at
runtime, they change size in relation to the bottom of the form. This means
the textbox on top stretches underneath the textbox below it... if you get
my drift.

Is there a webpage or something that shows how to correctly set up a form to
maximise? Can it be set through the IDE? I cant get the damn thing to resize
properly.

Thankd for any help.
Nov 16 '05 #1
8 7068
Hi Grant,

Don't know of any web pages, but you might want to put groups of controls in panels, and have the panels resize based on form change, and have the controls resize based on panel change.

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Grant,

I usually create a TestForm in design mode, and will place controls and set
achor as well as other properties. Then i will copy paste the generated code
inside "InitializeComponent".

Shak.
"Grant" <gp*****@hotmail.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
Hello,

Ive got a form with 3 textboxes - one under the other. When I set the anchor to top, left, right, and bottom for each of them and resize the form at
runtime, they change size in relation to the bottom of the form. This means the textbox on top stretches underneath the textbox below it... if you get
my drift.

Is there a webpage or something that shows how to correctly set up a form to maximise? Can it be set through the IDE? I cant get the damn thing to resize properly.

Thankd for any help.

Nov 16 '05 #3
kewl so what are those other properties that you set? If I have two text
boxes on my form and set the top textbox anchor to left, right and top - and
the bottom text box anchor to bottom, left, right - they get this big gap in
the middle when the form maximises. How do I get it so the two text boxes
look proportinally the same size no matter what size the form?

Thanks for your suggestions. sorry for my slow uptake.

"Shakir Hussain" <sh**@nodomain.com> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
Grant,

I usually create a TestForm in design mode, and will place controls and
set
achor as well as other properties. Then i will copy paste the generated
code
inside "InitializeComponent".

Shak.
"Grant" <gp*****@hotmail.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
Hello,

Ive got a form with 3 textboxes - one under the other. When I set the

anchor
to top, left, right, and bottom for each of them and resize the form at
runtime, they change size in relation to the bottom of the form. This

means
the textbox on top stretches underneath the textbox below it... if you
get
my drift.

Is there a webpage or something that shows how to correctly set up a form

to
maximise? Can it be set through the IDE? I cant get the damn thing to

resize
properly.

Thankd for any help.


Nov 16 '05 #4
Ok...

textbox1, textbox2, textbox3 must have the same anchor properties
left,top,right. Place textbox1, textbox2 and textbox3 one under other.

Add textbox3.width = textbox2.width = textbox1.width, during form load.

Now if you maximize the form....both will perfectly align, with same width
and no gaps.

Shak.

"Grant" <gp*****@hotmail.com> wrote in message
news:ut*************@TK2MSFTNGP09.phx.gbl...
kewl so what are those other properties that you set? If I have two text
boxes on my form and set the top textbox anchor to left, right and top - and the bottom text box anchor to bottom, left, right - they get this big gap in the middle when the form maximises. How do I get it so the two text boxes
look proportinally the same size no matter what size the form?

Thanks for your suggestions. sorry for my slow uptake.

"Shakir Hussain" <sh**@nodomain.com> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
Grant,

I usually create a TestForm in design mode, and will place controls and
set
achor as well as other properties. Then i will copy paste the generated
code
inside "InitializeComponent".

Shak.
"Grant" <gp*****@hotmail.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
Hello,

Ive got a form with 3 textboxes - one under the other. When I set the

anchor
to top, left, right, and bottom for each of them and resize the form at
runtime, they change size in relation to the bottom of the form. This

means
the textbox on top stretches underneath the textbox below it... if you
get
my drift.

Is there a webpage or something that shows how to correctly set up a
form to
maximise? Can it be set through the IDE? I cant get the damn thing to

resize
properly.

Thankd for any help.



Nov 16 '05 #5
Hi Grant,
Hello,

Ive got a form with 3 textboxes - one under the other. When I set the anchor
to top, left, right, and bottom for each of them and resize the form at
runtime, they change size in relation to the bottom of the form. This means
the textbox on top stretches underneath the textbox below it... if you get
my drift.

Is there a webpage or something that shows how to correctly set up a form to
maximise? Can it be set through the IDE? I cant get the damn thing to resize
properly.

Thankd for any help.


Did your form should look like below?

+--------+---------+
| text1 | text2 |
+--------+---------+
| text3 |
| |
+--------+---------+

If your answer is yes.... then i can propose you to set anchors:

text1.Anchor=AnchorStyles.Top | AnchorStyles.Left;
text2.Anchor=AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
text3.Anchor=AnchorStyles.Top | AnchorStyles.Left
| AnchorStyles.Right | AnchorStyles.Bottom;

Give me feedback if "design" vision doesn't look like yours.

Regards

Marcin
Nov 16 '05 #6
Hey Marcini - this is what my form looks like:

The poroblem is the middle textbox.

+--------+---------+
| text1 |
+--------+---------+
| text2 |

+--------+---------+
| text3 |
+--------+---------+

cheers,
Grant
"Marcin Grzębski" <mg*******@taxussi.no.com.spam.pl> wrote in message
news:ca**********@nemesis.news.tpi.pl...
Hi Grant,
Hello,

Ive got a form with 3 textboxes - one under the other. When I set the
anchor to top, left, right, and bottom for each of them and resize the
form at runtime, they change size in relation to the bottom of the form.
This means the textbox on top stretches underneath the textbox below
it... if you get my drift.

Is there a webpage or something that shows how to correctly set up a form
to maximise? Can it be set through the IDE? I cant get the damn thing to
resize properly.

Thankd for any help.


Did your form should look like below?

+--------+---------+
| text1 | text2 |
+--------+---------+
| text3 |
| |
+--------+---------+

If your answer is yes.... then i can propose you to set anchors:

text1.Anchor=AnchorStyles.Top | AnchorStyles.Left;
text2.Anchor=AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
text3.Anchor=AnchorStyles.Top | AnchorStyles.Left
| AnchorStyles.Right | AnchorStyles.Bottom;

Give me feedback if "design" vision doesn't look like yours.

Regards

Marcin

Nov 16 '05 #7
Hi Grant,

<snip> :)
Hey Marcini - this is what my form looks like:

The poroblem is the middle textbox.

+--------+---------+
| text1 |
+--------+---------+
| text2 |

+--------+---------+
| text3 |
+--------+---------+


text1.Anchor=AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
text3.Anchor=AnchorStyles.Top | AnchorStyles.Left
| AnchorStyles.Right | AnchorStyles.Bottom;
text2.Anchor=AnchorStyles.Bottom | AnchorStyles.Left
| AnchorStyles.Right;

Cheers!

Marcin
Nov 16 '05 #8
Hi Grant,

<snip> :)
Hey Marcini - this is what my form looks like:

The poroblem is the middle textbox.

+--------+---------+
| text1 |
+--------+---------+
| text2 |

+--------+---------+
| text3 |
+--------+---------+

text1.Anchor=AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
text2.Anchor=AnchorStyles.Top | AnchorStyles.Left
| AnchorStyles.Right | AnchorStyles.Bottom;
text3.Anchor=AnchorStyles.Bottom | AnchorStyles.Left
| AnchorStyles.Right;

(I replaced text2 with text3! - my fault!)

Cheers!

Marcin
Nov 16 '05 #9

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

Similar topics

11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
1
by: Terry | last post by:
I've seen several posts from people who have seen this flashing in TreeView's when resizing a form. I've noticed it in my app, but only in the child windows. For example, my main form has a...
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
12
by: Sřren Reinke | last post by:
Hi there I have a little problem. How do i make sure that a graph is not redrawn while the form with the graph is being resized ? I have tried to add a mouse up/down event handler on the...
6
by: John Bowman | last post by:
Hi All, I must be missing something really obvious, so I'd appreciate someone helping me out. I have a simple Windows form that currently only has a title bar (aka the Text Property is set) and...
5
by: Alex K. | last post by:
I need to call some procedures after user resized the form. Not while he is resizing it, but AFTER resizing is finished, i.e. user released mouse button. Any ideas how to do this? Thank you
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...
11
by: Ajith Menon | last post by:
I have created a windows application in which the form needs to be resized on the MouseMove event. The windows resize function takes a lot of CPU cycles. And as the resize function is called on the...
6
by: JDeats | last post by:
I have a WinForms based application written for the .NET Framework 2.0 and in this application I need to be able to be able to take some action in code when the user finishes resizing the form. ...
0
by: Peter Anthony | last post by:
It seems kind of strange that if a Form is just moved that Resize events fire. This makes it hard to tell the difference betweeen resizing and moving a Form. I can understand why resizing might...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.