Hi,
I had this code kindly posted for me in this group a while back and it gives
curved corners to a form. I think something similar will work for Controls.
Private Sub BaseForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Draw Form
If Not Me.DesignMode Then 'Just learnt this today!!
Me.FormBorderStyle = FormBorderStyle.None
Me.StartPosition = FormStartPosition.CenterScreen
Me.Size = New Size(800, 500)
Dim p As New System.Drawing.Drawing2D.GraphicsPath
Dim CurveSize As Int32 = 250
p.StartFigure()
p.AddArc(New Rectangle(0, 0, CurveSize, CurveSize), 180, 90)
p.AddLine(CurveSize, 0, Me.Width - CurveSize, 0)
p.AddArc(New Rectangle(Me.Width - CurveSize, 0, CurveSize,
CurveSize), -90, 90)
p.AddLine(Me.Width, CurveSize, Me.Width, Me.Height - CurveSize)
p.AddArc(New Rectangle(Me.Width - CurveSize, Me.Height -
CurveSize, CurveSize, CurveSize), 0, 90)
p.AddLine(Me.Width - 40, Me.Height, 40, Me.Height)
p.AddArc(New Rectangle(0, Me.Height - CurveSize, CurveSize,
CurveSize), 90, 90)
p.CloseFigure()
Me.Region = New Region(p)
Me.BackColor = Color.Teal
p.Dispose()
end if
End Sub
--
Rod Gill
Project MVP
Visit
www.msproject-systems.com for Project Companion Tools and more
"Dino Buljubasic" <di**@noplacelikehome.com> wrote in message
news:ki********************************@4ax.com...
Hi,
I have several panels that holds bunch of controls with information on
my forms. My form has background image property set to an image that
has borders defining where my panel comes and that border is rounded
so when I set my panels border stile to none, the panel appear to have
the rounded border (that comes from the forms background image.
This looks really nice, but the problem is that my forms can not be
resizable then, since the background image is of fixed size.
How can I draw a border with rounded corners around my panel or other
controls and make it looks nice even when form is resized ?
Any help will be appreciated.
_dino_