c# - Secondary Monitor shows part of Primary Monitor -
i have created win app, uses secondary monitor show images. have used following code detect , set location of secondary monitor(which extended monitor of primary monitor).
public void secondarydisplay() { frmsecondarydisplay secdis = new frmsecondarydisplay(); screen[] screens = screen.allscreens; secdis.mybase = this; this.mysecscreen = secdis; secdis.show(); setformlocation(secdis, screens[1]); } private void setformlocation(form form, screen screen) { rectangle bounds = screen.bounds; form.setbounds(bounds.x, bounds.y, bounds.width, bounds.height); form.startposition = formstartposition.manual; }
problem getting thin 6mm white line on left corner of secondary display. nothing extension of primary display. how make disapper? on moving cursor secondary monitor , click on screen of secondary monitor white line disappears. , on moving cursor primary monitor , click on makes white line appear on secondary monitor. kindly me how can resolve issue. looks ugly in secondary mopnitor.
always prepared window properties before show()
public void secondarydisplay() { if (screen.allscreens.count() == 1) { return; // no second display } var secdis = new frmsecondarydisplay(); // shall use secdis.show(this) build relation of forms. // when "this" closes, second display form closes. secdis.mybase = this; this.mysecscreen = secdis; // setup windows position before show() secdis.startposition = formstartposition.manual; secdis.location = screen.allscreens[1].workingarea.location; secdis.topmost = true; secdis.formborderstyle = formborderstyle.none; secdis.windowstate = formwindowstate.maximized; secdis.show(this); // see comment above }
Comments
Post a Comment