c# - Re-sizing border-less form with a custom border -


the problem isn't don't know how make border-less form re-sizable, or how draw border. problem happens when re-size form custom border.

here screenshot, because don't know how explain it: when expanding form borders

here how created border (currently):

private void form1_paint(object sender, painteventargs e) {     int width = 1;     rectangle rec = this.clientrectangle;     buttonborderstyle bbs = buttonborderstyle.solid;     color clr = color.gray;     controlpaint.drawborder(e.graphics, rec, clr, width, bbs, clr, width, bbs, clr, width, bbs, clr, width, bbs); } 

as re-sizing border-less form; created repository project.
resize custom border - bitbucket

i don't have idea why happens, wouldn't know begin. need draw border without doing this. have tried other ways of drawing one, results same.

hopefully , repository becomes useful trying same.

thank taking time read if did.

try use graphics.drawrectangle instead of drawborder

protected override void onpaint(painteventargs e) {     base.onpaint(e);     single fwidth = 5.0f;     rectangle r = new rectangle(0,0,this.clientrectangle.width-1,this.clientrectangle.height-1);     e.graphics.drawrectangle(new pen(color.gray, fwidth), r); }  protected override void onresize(eventargs e) {     base.onresize(e);     this.invalidate(); } 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -