This does not work.
gLBxForecastCities.Items.Clear();
dlgForecast dlg = new dlgForecast();
WindowStartupLocation = WindowStartupLocation.CenterOwner;
dlg.ShowDialog();
How do I open a dialog box that opens centered on the current dialog box?
Arun PottiPosted Nov 1, 2026, 1:25 AM
Try this,
var dlg = new dlgForecast
{
Owner = this,
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
dlg.ShowDialog();
Clyde EisenbeisPosted Oct 30, 2026, 1:12 PM
This does work:
public dlgForecast(){InitializeComponent();WindowStartupLocation = WindowStartupLocation.CenterOwner;Owner = Application.Current.MainWindow;}//dlgForecast