-1

I want to do full screen application. But when the window state is maximize, it is not my expected result.

Btw I'm new to visual studio

When minimized

minimized

When maximized

maximized

Pablo Sarturi
  • 161
  • 1
  • 10
  • 3
    There is no standard size. Depends on the monitor you are using. the size is the number of pixels which is different for different monitors as well as different graphic modes. – jdweng May 06 '21 at 11:14
  • 2
    You need to create *dynamic layout*, so that the location and size of controls are depends on the size of parent container. In winforms you can use `TableLayoutPanel` and `FlowLayoutPanel`. – Sinatr May 06 '21 at 11:18
  • 1
    If you're expecting, whatever tool you use, that the Font will grow in size when the Form is expanded and shrink otherwise, you'll be disappointed, there's nothing like that, you have to recreate the Font and scale it yourself. – Jimi May 06 '21 at 11:36
  • 2
    _not my expected result_ Aha, What did you expect?? – TaW May 06 '21 at 11:37
  • Does [Scale windows forms window](https://stackoverflow.com/questions/22780571/scale-windows-forms-window) help? – Andrew Morton May 06 '21 at 11:38
  • 2
    Subjectively, WPF has a lot better support for (visually) scalable apps than Forms. – 500 - Internal Server Error May 06 '21 at 11:38
  • 1
    In WinForms every Control has the properties `Anchor` and `Dock`. With these you can make them sizeable to the outer form. A `SplitContainer` can help if you need to make two controls next to each other to distribute the width or height between them. – Oliver May 06 '21 at 12:02
  • 1
    You tagged this both C# and VB.NET and included neither in your question. – Dour High Arch May 06 '21 at 17:23
  • Basically, you can use `this.WindowState = FormWindowState.Maximized;` to maximize the form, and if you want to adjust Form controls when it ′ s maximized, check:[How to auto resize and adjust Form controls with change in resolution](https://stackoverflow.com/questions/4248637/how-to-auto-resize-and-adjust-form-controls-with-change-in-resolution) – Xingyu Zhao May 07 '21 at 02:28

1 Answers1

0

There's not a standard size. You should check your form to make sure it will work at the different likely screen sizes and aspect ratios.

In your example, you can use the Anchor property of controls to cause them to expand and contract with the form. For example, the "Welcome to WasteAid" section of your form can be put into a container (such as a panel), and the anchors of that container can be set to Top, Bottom, Right. The left side could be set to Top, Bottom, Left. You can anchor controls with a container, or anchor the controls individually without a container. You can drag a corner of the form around in design mode to see how it will work at different sizes and aspect ratios.

xpda
  • 15,585
  • 8
  • 51
  • 82