Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.StartPosition = FormStartPosition.CenterScreen
Me.TransparencyKey = Color.Fuchsia
End Sub
Private Sub Form1_Paint(ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles Me.Paint
' ----- Draw a nice logo form.
e.Graphics.Clear(Color.Fuchsia)
e.Graphics.FillRectangle(Brushes.Gold, 0.0F, _
Me.ClientRectangle.Height / 3.0F, _
CSng(Me.ClientRectangle.Width), _
Me.ClientRectangle.Height / 3.0F)
e.Graphics.FillPolygon(Brushes.Gold, New PointF() { _
New Point(Me.ClientRectangle.Width / 4, 0), _
New Point(Me.ClientRectangle.Width / 2, _
Me.ClientRectangle.Height / 2), _
New Point(Me.ClientRectangle.Width / 4, _
Me.ClientRectangle.Height), _
New Point(0, Me.ClientRectangle.Height / 2)})
Dim largerFont = New Font(Me.Font.Name, 20)
e.Graphics.DrawString("My Nice Program", _
largerFont, Brushes.Black, 20, _
(Me.ClientRectangle.Height / 2) - _
(largerFont.Height / 2))
End Sub
End Class
Keterangan :
Program di atas akan menghilangkan form border dan jika ada warna Fuchsia akan dibuat transparan.
Tidak ada komentar:
Posting Komentar