C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Graphics »

Chnaging Shape Of The Form


Posted Date: 11 Sep 2008    Resource Type: Code Snippets    Category: Graphics
Author: Hefin DsouzaMember Level: Diamond    
Rating: 1 out of 5Points: 10



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

Attachments

  • Download Application (20968-111033-ShapeForm.rar)



  • Responses


    No responses found. Be the first to respond and make money from revenue sharing program.

    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Sign In to add tags.
    Shape changing Form in vb.net  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: Dynamic Watermarking Images in C#.NET
    Previous Resource: Name Shaped Form
    Return to Discussion Resource Index
    Post New Resource
    Category: Graphics


    Post resources and earn money!
     
    Related Resources



    dotNet Slackers

    About Us    Contact Us    Privacy Policy    Terms Of Use