question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SizeToContent not sizing correctly

See original GitHub issue

I have made a message box for one of my programs but it is not sizing as it should

image

I have got SizeToContent="WidthAndHeight" in the xaml file

Happens on Windows and Linux (Can’t test macOS because I don’t have a mac/macOS VM)

repo with code: https://github.com/AzyIsCool/HATE

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Gillibaldcommented, Mar 21, 2020

Will have a look shortly

1reaction
Gillibaldcommented, Apr 26, 2019

We know that the Grid has issues and plan to adopt the Wpf implementation when the source code is made available. I guess the StackPanel tells the TextBlock there is infinite space so you have to use a DockPanel instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF SizeToContent not working when WindowStyle="None"
When WindowStyle="None" the width is too wide, it's about 200. However when I set WindowStyle="ToolWindow" both width and height are correct.
Read more >
Window.SizeToContent Property (System.Windows)
Gets or sets a value that indicates whether a window will automatically size itself to fit the size of its content.
Read more >
Sizing Controls when Main Window resizes
I am struggling with a WPF project where I am trying to keep a grid maximized within a ThemedWindow both when the window...
Read more >
Widget component "Size Box" does not resize properly
I have made a simple UI widget consisting of not much more then a vertical box filled with two text components and a...
Read more >
WPF Re-Size your Main Window from your UserControls
Size-to-content just doesn't give you the window sizes you want for each usercontrol.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found