how to set the border Line for the winForm in C#?
-
how to set the border Line of the winForm in C#? and set the border line color ? Thanks !
-
how to set the border Line of the winForm in C#? and set the border line color ? Thanks !
-
do you mean the border of the whole form, or just a specific control?
If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
I want to set the border of the whole form.
-
I want to set the border of the whole form.
well as far as im aware there is no property for that so you will have to do it some other way, here is a couple of options: Option 1: Handle the paintEvent (or override OnPaint)for the form and add some code such as - e.Graphics.DrawRectangle(...); Be aware that controls maybe be drawn ontop of the border depending on placement Option 2: Create a panel, which will be your 'Main Panel' place this on the form but slightly offset its size and position so the mainForm background color can be set to the desired border color and you should only see a border effect, of course you set the 'Main Panel' backColor to be what ever you want your main backColor to be Hope these make sense
If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
-
I want to set the border of the whole form.
Without adding some serious code to handle redrawing the non-client area (NOT EASY!) of the form, you can't. The window borders are drawn according to the system settings and they are for every window you see, not just yours.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
well as far as im aware there is no property for that so you will have to do it some other way, here is a couple of options: Option 1: Handle the paintEvent (or override OnPaint)for the form and add some code such as - e.Graphics.DrawRectangle(...); Be aware that controls maybe be drawn ontop of the border depending on placement Option 2: Create a panel, which will be your 'Main Panel' place this on the form but slightly offset its size and position so the mainForm background color can be set to the desired border color and you should only see a border effect, of course you set the 'Main Panel' backColor to be what ever you want your main backColor to be Hope these make sense
If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
Thanks musefan, I'll attempt to handle with your suggestion
-
Without adding some serious code to handle redrawing the non-client area (NOT EASY!) of the form, you can't. The window borders are drawn according to the system settings and they are for every window you see, not just yours.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Thank Dave