1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-23 02:34:08 +02:00

Fix the About Form not starting centered to parent

This commit is contained in:
chylex 2016-04-11 02:16:39 +02:00
parent e4853b6697
commit d235ea85ef

View File

@ -8,6 +8,7 @@
using System.Text; using System.Text;
using TweetDick.Core.Handling; using TweetDick.Core.Handling;
using TweetDick.Core.Other; using TweetDick.Core.Other;
using System.Drawing;
namespace TweetDick.Core{ namespace TweetDick.Core{
public partial class FormBrowser : Form{ public partial class FormBrowser : Form{
@ -47,6 +48,11 @@ protected override void WndProc(ref Message m){
} }
} }
private void ShowChildForm(Form form){
form.Show(this);
form.Location = new Point(Location.X+Width/2-form.Width/2,Location.Y+Height/2-form.Height/2);
}
// window setup // window setup
private void SetupWindow(){ private void SetupWindow(){
@ -108,7 +114,7 @@ public void OpenAbout(){
else{ else{
currentFormAbout = new FormAbout(); currentFormAbout = new FormAbout();
currentFormAbout.FormClosed += (sender, args) => currentFormAbout = null; currentFormAbout.FormClosed += (sender, args) => currentFormAbout = null;
currentFormAbout.Show(this); ShowChildForm(currentFormAbout);
} }
} }