Win Form - resize form problem
-
Hey, When I programed a new software in C# with Windows Form I got an "unsolved" problem that I hope you can help me with: I written a form, when I resizing it the form get bigger but the controls still the same. I wanted to know if there is a .NET built in command that can solve that probem? or i have to use the "Resize" event and set it myself?. And if yes - when i get the Resize event, can i know what is the last size before the resize and now? (like when i get the EventArgs e can i do someting like e.LastX or e.LastY)? Thanks you very moch!, Yahav.
Gindi Bar Yahav - Web & Software developer.
-
Hey, When I programed a new software in C# with Windows Form I got an "unsolved" problem that I hope you can help me with: I written a form, when I resizing it the form get bigger but the controls still the same. I wanted to know if there is a .NET built in command that can solve that probem? or i have to use the "Resize" event and set it myself?. And if yes - when i get the Resize event, can i know what is the last size before the resize and now? (like when i get the EventArgs e can i do someting like e.LastX or e.LastY)? Thanks you very moch!, Yahav.
Gindi Bar Yahav - Web & Software developer.
-
Hey, When I programed a new software in C# with Windows Form I got an "unsolved" problem that I hope you can help me with: I written a form, when I resizing it the form get bigger but the controls still the same. I wanted to know if there is a .NET built in command that can solve that probem? or i have to use the "Resize" event and set it myself?. And if yes - when i get the Resize event, can i know what is the last size before the resize and now? (like when i get the EventArgs e can i do someting like e.LastX or e.LastY)? Thanks you very moch!, Yahav.
Gindi Bar Yahav - Web & Software developer.
You can use Control's .Anchor to dock the control according to the container size, though controlling how the controls resize is limited. Or you can put the controls in a TableLayoutPanel or FlowLayoutPanel, you will have more control on how the controls react to resizing.
-
You can use Control's .Anchor to dock the control according to the container size, though controlling how the controls resize is limited. Or you can put the controls in a TableLayoutPanel or FlowLayoutPanel, you will have more control on how the controls react to resizing.
So there is no other way to "say" to C# - "I want that control (for example button) to resize automatic"?
Gindi Bar Yahav - Web & Software developer.
-
So there is no other way to "say" to C# - "I want that control (for example button) to resize automatic"?
Gindi Bar Yahav - Web & Software developer.
-
Hey, When I programed a new software in C# with Windows Form I got an "unsolved" problem that I hope you can help me with: I written a form, when I resizing it the form get bigger but the controls still the same. I wanted to know if there is a .NET built in command that can solve that probem? or i have to use the "Resize" event and set it myself?. And if yes - when i get the Resize event, can i know what is the last size before the resize and now? (like when i get the EventArgs e can i do someting like e.LastX or e.LastY)? Thanks you very moch!, Yahav.
Gindi Bar Yahav - Web & Software developer.
As the others have already answered. The controls aren't set to grow automatically... If that helps solving the problem, you can set the border to Fixed (so that it is not resized), however that doesn't solve the problem. To actually solve the problem you can either handle the Resize event and grow the controls accordingly, but what would seem better (and easier) would be to click the controls in Designer mode and setting their Anchor to the most according manner. I have had no problems with this method so far. With regards to the last part of your question, I believe that you can get to know the previous size by checking on the ResizeBegin event, and comparing with the ResizeEnd or Resize event. There might be easier solutions, it's just one that came to my mind at the moment. Regards, Trapper
-
So there is no other way to "say" to C# - "I want that control (for example button) to resize automatic"?
Gindi Bar Yahav - Web & Software developer.