better form start position detection

This commit is contained in:
Pilzinsel64
2025-07-02 13:39:00 +02:00
parent d615aaecc5
commit b4d77667bc
2 changed files with 5 additions and 5 deletions

View File

@@ -44,13 +44,13 @@ partial class RadDialogBase
public static T Show<T>(T dialogPanel, IWin32Window? parent, string? title, object? icon) where T : RadFlyoutBase public static T Show<T>(T dialogPanel, IWin32Window? parent, string? title, object? icon) where T : RadFlyoutBase
{ {
CreateForm(dialogPanel, parent, title, icon).Show(); CreateForm(dialogPanel, parent, title, icon, FormStartPosition.CenterScreen).Show();
return dialogPanel; return dialogPanel;
} }
public static T ShowDialog<T>(T dialogPanel, IWin32Window? parent, string? title, object? icon) where T : RadFlyoutBase public static T ShowDialog<T>(T dialogPanel, IWin32Window? parent, string? title, object? icon) where T : RadFlyoutBase
{ {
CreateForm(dialogPanel, parent, title, icon).ShowDialog(); CreateForm(dialogPanel, parent, title, icon, FormStartPosition.CenterParent).ShowDialog();
return dialogPanel; return dialogPanel;
} }
@@ -61,7 +61,7 @@ partial class RadDialogBase
return dialogPanel; return dialogPanel;
} }
private static RadDialogBase CreateForm<T>(T dialogPanel, IWin32Window? parent, string? title, object? icon) where T : RadFlyoutBase private static RadDialogBase CreateForm<T>(T dialogPanel, IWin32Window? parent, string? title, object? icon, FormStartPosition startPosition) where T : RadFlyoutBase
{ {
dialogPanel.Dock = DockStyle.Fill; dialogPanel.Dock = DockStyle.Fill;
@@ -74,7 +74,7 @@ partial class RadDialogBase
{ {
Text = title, Text = title,
Icon = icon as Icon, Icon = icon as Icon,
StartPosition = parent == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent, StartPosition = startPosition,
ClientSize = dialogPanel.Size ClientSize = dialogPanel.Size
}; };

View File

@@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<Version>2.12.3</Version> <Version>2.12.4</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>