File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,18 @@ public void Globalization()
9191 State . Text = Locale . columnState ; // State column
9292 }
9393
94+ private void AutoAdjustScreensize ( )
95+ {
96+ var screen = Screen . FromControl ( this ) ;
97+ var screenSize = screen . Bounds . Size ;
98+
99+ if ( Width > screenSize . Width )
100+ Width = screenSize . Width ;
101+
102+ if ( Height > screenSize . Height )
103+ Height = screenSize . Height - 30 ; //Height -30 because of the Windows Task bar
104+ }
105+
94106 public MainWindow ( )
95107 {
96108 // Uncomment lower line and add lang code to run localization test
@@ -109,6 +121,9 @@ public MainWindow()
109121
110122 // GUI localization
111123 Globalization ( ) ;
124+
125+ //Adjust to current screensize if window is too big
126+ AutoAdjustScreensize ( ) ;
112127 }
113128
114129 public void InitializeSettings ( )
You can’t perform that action at this time.
0 commit comments