-
April 18th, 2012, 09:17 PM
#1
UI resizing
hello all,
I am new to C Sharp development, I have experience in Java and C++ programming. I am currently developing a program for our plc controller. Could someone please advise me how to resize the controls on a Windows form when the form is either being resized or being maximised.
What I want is for my UI elements like buttons, data grid to maintain their relative positions within the Windows form however when the form is either resize or maximised I want these controls to grow with them and occupy the whole screen space like it does in other programming environments such as C++ or Java. Thank you in advance.
-
April 18th, 2012, 09:18 PM
#2
Re: UI resizing
Last edited by aamir121a; April 18th, 2012 at 09:20 PM.
-
April 19th, 2012, 01:51 AM
#3
Re: UI resizing
Cannot view screenshot from where I am, but seems your problem can be solved with anchor property.
Example :
Code:
this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
Anchor allows you to attach a control to a side of the GUI. Imagine a real chain linking the item to the border chosen.
When you anchor something to the right only it'll keep it's position relative to the right border and moves as the form will be resized.
If you tie it both to left and right at same time, the item will be expanded/collapsed as your form is resized.
(if you're using Visual Studio, check the property window of each GUI object)
-
April 19th, 2012, 07:10 AM
#4
Re: UI resizing
thank you , yes I remember now it was , I did come across it few years back , just could not remember the name.
-
April 19th, 2012, 07:12 AM
#5
Re: UI resizing
Seems to work for re size event how about maximize , ( button ) at the top right hand side of the window
-
April 19th, 2012, 08:26 AM
#6
Re: UI resizing
Works the same like a resize in all directions
Last edited by Erendar; April 19th, 2012 at 08:31 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|