wpf - Control in code which screen a window shell open on, when using extended monitor mode -


i have 1 main window in wpf application, , when clicking on button new window opening. now, when i'm using 2 monitors extended display - when i'm running app on primary screen , clicks button open second window, it's appearing in same screen , that's ok. but, when i'm dragging main window secondary screen , clicks button, second window still opens in primary screen , not want.

i want second window open in screen main window does.

how can code?

you can use windowstartuplocation property. set centerscreen or centerowner. centerowner work, on second screen need set owner property first window.

if need fine-tune positioning, can use screen object (from system.windows.forms namespace/assembly).


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -