I have searching and the result cannot solve my case. Actually I have a panel and I want the panel have thicker border than Windows given. I need BorderStyle
BorderStyle.FixedSingle
thicker.. Thanks before
I have searching and the result cannot solve my case. Actually I have a panel and I want the panel have thicker border than Windows given. I need BorderStyle
BorderStyle.FixedSingle
thicker.. Thanks before
You have to customize your own
Panel
with a little custom painting:Here is the screen shot of panel with thickness of
30
:NOTE: The Size of
Rectangle
is calculated at the middle of the drawing line, suppose you draw line with thickness of4
, there will be an offset of 2 outside and 2 inside.I didn't test the case given by Mr
Hans
, to fix it simply handle the eventSizeChanged
for yourpanel1
like this:You can also setting
ResizeRedraw = true
usingReflection
without having to handle theSizeChanged
event as above like this:You may see a little flicker when resizing, just add this code to enable doubleBuffered for your panel1:
Create a new, slightly larger panel and set the background colour to Black (or whatever). Place the original panel INSIDE the larger panel.