How to resise controls when maximising the C# Application?
-
hi all, I have done a C# Applcation with TextBoxes,Labels and DataGrid.Default Window State of the Form is "Normal". Now I want to resise Controls in the Window Form when maximising the Dialog.. How can I do it?if any one knows it ,please reply me.. thanks in advance..
-
hi all, I have done a C# Applcation with TextBoxes,Labels and DataGrid.Default Window State of the Form is "Normal". Now I want to resise Controls in the Window Form when maximising the Dialog.. How can I do it?if any one knows it ,please reply me.. thanks in advance..
you can use the Anchor propriety of the controls to a certain degree. For example if you have a control Anchored to a margine, whenever that margine is moved the control will always keep the same distance from that margine. if the control is Anchored to two oposed Margines(left and right for example), when the parent control is resized, the control will increase his size acordingly so as to keep the same distances from the margins(in the left right case he will increase his width). Anchors work in desing mode too .. you should try and experimet with them there. if you want more control you can handle the SizeChanged event of the parent control (this beeing in your case the main form).
-
you can use the Anchor propriety of the controls to a certain degree. For example if you have a control Anchored to a margine, whenever that margine is moved the control will always keep the same distance from that margine. if the control is Anchored to two oposed Margines(left and right for example), when the parent control is resized, the control will increase his size acordingly so as to keep the same distances from the margins(in the left right case he will increase his width). Anchors work in desing mode too .. you should try and experimet with them there. if you want more control you can handle the SizeChanged event of the parent control (this beeing in your case the main form).
Thanks for reply.. This Method is work successfully if one control in the Windows Form. How is this implement to WindowForm exist with many Controls..?
-
Thanks for reply.. This Method is work successfully if one control in the Windows Form. How is this implement to WindowForm exist with many Controls..?
It works with many controls as well. If you do it right. What does not work? Claudio Claudio's Website Hommingberger Gepardenforelle
-
hi all, I have done a C# Applcation with TextBoxes,Labels and DataGrid.Default Window State of the Form is "Normal". Now I want to resise Controls in the Window Form when maximising the Dialog.. How can I do it?if any one knows it ,please reply me.. thanks in advance..
-
It works with many controls as well. If you do it right. What does not work? Claudio Claudio's Website Hommingberger Gepardenforelle
hi if we add many controls to the Application,and do Anchor for all controls,after that maximising several times, some controls are going to invisible. that's the problem.
-
hi if we add many controls to the Application,and do Anchor for all controls,after that maximising several times, some controls are going to invisible. that's the problem.
Sounds very strange. Never heard of that one. But I've experienced similar problems in other situations (I have a button on a tabpage that tends to disappear when I disable/enable it). Do they appear again when you manually call Invalidate() on the form after maximising? Maybe that could be a workaround. Claudio Claudio's Website Hommingberger Gepardenforelle