c# - WPF maximize main window with center for application -


i have wpf application , want maximize main window. tried below code issue window maximized not centered. want window maximized maximize window mouse click. code is:

 mainwindow.height = systemparameters.maximizedprimaryscreenheight;  mainwindow.width = systemparameters.maximizedprimaryscreenwidth; 

set windowstate property instead of width , height:

mainwindow.windowstate = windowstate.maximized; 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - IIFE: var vs this - is there any difference? -

ios - Google API (YouTube search): Bad network response -