c# - Showing a Windows form on a secondary monitor? -


i'm trying set windows form on secondary monitor, follows:

private void button1_click(object sender, eventargs e) {     matrixview n = new matrixview();     screen[] screens = screen.allscreens;     setformlocation(n, screens[1]);     n.show(); }  private void setformlocation(form form, screen screen) {     // first method     rectangle bounds = screen.bounds;     form.setbounds(bounds.x, bounds.y, bounds.width, bounds.height);      // second method     //point location = screen.bounds.location;     //size size = screen.bounds.size;      //form.left = location.x;     //form.top = location.y;     //form.width = size.width;     //form.height = size.height; } 

the properties of bounds seem correct, in both methods i've tried, maximizes form on primary monitor. ideas?

try setting windowstartuplocation parameter "manual" inside setformlocation method.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -