|
|
Title | Make a picture-shaped form in VB .NET |
Keywords | picture-shaped form, shaped form, transparent, VB.NET |
Categories | Graphics, VB.NET |
|
|
Set the form's BackgroundImage property to the picture. Make the picture red where you don't want the form to appear. Then set the form's TransparencyKey property to red.
That's all there is to it. This program also resizes the form at runtime to fit the picture but you can do that at design time if you like. You may also want to set the form's FormBorderStyle property to None.
|
|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
' Fit the form to the picture.
Width = Me.BackgroundImage.Width
Height = Me.BackgroundImage.Height
End Sub
|
|
|
|
|
|