3

I'm having a problem with auto sizing all of the controls on my WPF. I'm able to get them too stay on the side of the screen where I want them, the only problem is that, when I have the window the same size as the editor, it looks perfect, however, when I change too full screen (Has too be full screen), it centers everything rather then stretching too fit across the entire window.

Any idea how I could go about fixing this? I have provided a few photos.

Windowed Size

Fullscreen

After doing a lot of research, I found putting it in a panel, and then making the panel Anchor too none and then setting the Alignment too none, it fixed the windowed version but not full screen version. Any help would be great.

I'm setting the window too full screen with this.WindowState = FormWindowState.Maximized; if that makes any difference at all?

LarsTech
  • 80,625
  • 14
  • 153
  • 225

1 Answers1

2

The grid should help you with that, just define columnas and rows. Then put the controls inside the rows and change the alignment (vertical and horizontal) to stretch and you are done.

You will have a problem with the text size, that need tl be managed in code behind or in your viewmodel

If you want a control to span on múltiple rows or multiple columns use the grid.rowspan and grid. Columnspan properties.

Sorry for the bad formatting, im on the phone

Bloodday
  • 303
  • 1
  • 15