Click here to Skip to main content
15,908,775 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i want to develop a small from in this 4-5 controls in this.

i this have a 2 button , 1 textbox and 1 image control.

that runtime i want to interest for resize a from that time control are not show properly.

so, how to set all control on re-size a from .


thank you,..
Posted
Comments
BillWoodruff 7-Jan-14 9:33am    
Are the Controls all added to the ControlCollection of the Form, or are they in another ContainerControl, like a Panel ?

What are the settings of the Controls Anchor and Dock properties now ?

You want the Controls to stay the same size, but remain visible: correct ?

1 solution

Winforms doesn't do that well when you resize all it's controls - it can enlarge or shrink a button or a text box for example, but it won't change the text size it uses, which can make it look a bit silly.

However, what you probably want to do is fix some controls relative to the edges or the form, and resize the image:
iiiiiiiii
iiiiiiiii
iiiiiiiii
iiiiiiiii
ttttt b b
becomes:
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiii
tttttttttttttt b b

In which case, look at the Anchor property of each control:
Image should be Top, Left, Bottom, and Right
TextBox should be Left, Bottom and Right
the two buttons should be Bottom and Right only.

Try it: you'll see what I mean.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900