Public Class Form1
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case 132
MyBase.WndProc(m)
If m.Result = 1 Then m.Result = 2
Case Else
MyBase.WndProc(m)
End Select
End Sub
Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
Dim a As New System.Drawing.Drawing2D.LinearGradientBrush(New RectangleF(0, 0, Me.Width, Me.Height), Color.LightGray, Color.Black, Drawing.Drawing2D.LinearGradientMode.Vertical)
Dim g As Graphics = Me.CreateGraphics
g.FillRectangle(a, New RectangleF(0, 0, Me.Width, Me.Height))
g.Dispose()
Dim path As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath()
path.StartFigure()
path.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
path.AddLine(40, 0, Me.Width - 40, 0)
path.AddArc(New Rectangle(Me.Width - 40, 0, 40, 40), -90, 90)
path.AddLine(Me.Width, 40, Me.Width, Me.Height - 40)
path.AddArc(New Rectangle(Me.Width - 40, Me.Height - 40, 40, 40), 0, 90)
path.AddLine(Me.Width - 40, Me.Height, 40, Me.Height)
path.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
Me.Region = New Region(path)
Me.Opacity = 50
Me.Show()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.Width = 400
Me.Height = 400
Me.Left = 150
Me.Top = 200
End Sub
End Class