How does the .NET MessageBox determine its size relative to the resolution of the screen on which it is displayed?
I am writing a slightly more flexible dialog box for a WPF application. The location of the window is laid out in the grid:
+----------------- | auto: Header
The Content cell can be VERY large. In one of my use cases, the user wants to remove x elements from the list. Then the items are listed in the confirmation dialog box. If there are many (say, 50+) elements, the window can become large - too large for my taste.
What I need is a function that defines the MaxHeight and MaxWidth dialog box on the current screen in a way that mimics the Microsoft MessageBox dialog box.
PS: I call the message dialog with the following static method:
// MessageDialog class public static object Show( Window owner, FrameworkElement content, string title, string header, params MessageDialogButton[] buttons );
PPS: to determine the screen on which the dialog will be displayed, the screen on which the MessageDialog Owner window is located is displayed. The first (main) screen is used as a backup.
source share