Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransparencyKey

Status
Not open for further replies.

KizMar

Technical User
Mar 13, 2002
52
US
I'm trying to make a form that has an irregular shape and I'm not quite understanding how this works. I can get the Transparency Key to work for the form background (make the background of the form see through). When I put an image on the form it doesn't work. I am reading a book that says what I'm doing should work. I know this information isn't very detailed, but I also have no clue how I should be doing this. if anyone out there has played with this feature before, please let me know!
 
To shape a form irregularly, you need to create a graphics path that defines the shape you want the form to be, then apply the graphics path to the forms Region property:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim gp As New System.Drawing.Drawing2D.GraphicsPath()

gp.AddEllipse(0, 0, Me.Width, Me.Height)

Me.Region = New Region(gp)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top