This Code Sample Allows You to change the shape of a form.
Using The Me.Region Property one can change the shape of the form. A Little Practice is Required to be an Expert in creating Shapes.
Private Sub MakeCircle(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Panel2.Location = New Point(72, 296) Dim a As New Drawing2D.GraphicsPath() Dim b As New Drawing2D.DashStyle() Dim rt As New Rectangle() a.AddEllipse(0, 0, 400, 400) Me.Region = New Region(a) a.Reset() a.AddEllipse(25, 9, 45, 45) Button1.FlatStyle = New BorderStyle() = BorderStyle.Fixed3D Button1.Region = New Region(a) Button2.FlatStyle = New BorderStyle() = BorderStyle.Fixed3D Button2.Region = New Region(a) a.Reset() rt.X = 25 rt.Y = 9 rt.Height = 45 rt.Width = 45 a.AddArc(rt, 130, 360) Button3.FlatStyle = New Border3DStyle() = Border3DStyle.RaisedOuter Button3.Region = New Region(a) Button4.Height = 50 End Sub
This code Changes the Form Shape and Shape of other Child Controls to a Circle. This code Restores the Form Shape back to Normal.
Private Sub RestoreShape(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Region = New Region() Button1.Region = New Region() Button2.Region = New Region() Button3.Region = New Region() Button4.Region = New Region() Button4.Height = 64 End Sub
Download the Sample Application.
================================================================================ Regards Hefin Dsouza
AttachmentsDownload Application (20968-111033-ShapeForm.rar)
|
No responses found. Be the first to respond and make money from revenue sharing program.
|