I have been looking all other the net, searching the forum. I can't find any API for rouding corners for forms in VB.NET.
Please help me find a example code, since I am kind of newbie!
Thanks in advance.
Printable View
I have been looking all other the net, searching the forum. I can't find any API for rouding corners for forms in VB.NET.
Please help me find a example code, since I am kind of newbie!
Thanks in advance.
Check out Region Master Controls - not only rounded corners, but even discontinious forms - really neat stuff.
http://www.windowsforms.net/ControlG...219&tabindex=0
Hi,
Perhaps you can obtain the same effect by coding if you create an ellipse with a different backcolor and place all your controls inside it. Then make the form fullscreen, set the form.text to "" and hide the controlbox. viz
VB Code:
With Me .WindowState = FormWindowState.Maximized .Text = "" .ControlBox = False End With
You can, of course, put hyperbolic curves on your form and backcolor the area inside or outside of them different colors, if you don't want a pure ellipse.
Still need help :)
I need a example-code of rounded corners in a form!
The Region Master download is an example, complete with full source code. Have you even tried it?
To draw rounded corners it is necessary to familiarize yourself with the GraphicsPath object as well as Arcs and pretty much all drawing concepts.
This code will do what you ask, but you will have to modify it for your purposes:
VB Code:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim gpBrush As LinearGradientBrush Dim gp As New GraphicsPath gpBrush = New LinearGradientBrush(New Point(0, 0), New Point(Me.Width, 40), Color.MidnightBlue, Color.White) gp.AddArc(0, 0, 20, 20, 180, 90) gp.AddArc(Me.Width - 22, 0, 20, 20, 270, 90) 'e.Graphics.FillRectangle(gpBrush, New Rectangle(0, 0, Me.Width, 20)) e.Graphics.FillPath(gpBrush, gp) End Sub