7 Şubat 2014 Cuma
Yuvarlak-Kalp-Oval Form Oluşturma Kodu
KOD İNDİR
Public Class Form1 Const i As Integer = &HA1 Const j As Integer = 2 Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then Label1.Hide() Label2.Hide() Panel1.Capture = False Dim msg As Message = Message.Create(Me.Handle, i, New IntPtr(j), IntPtr.Zero) Me.DefWndProc(msg) End If End Sub Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load NormalFrmTsmn.Enabled = False DaireTSmn.Enabled = True KalpTSmn.Enabled = True ElipsTSmn.Enabled = True End Sub Private Sub ElipsTSmn_Click(sender As System.Object, e As System.EventArgs) Handles ElipsTSmn.Click Dim CizimYeri As New Drawing2D.GraphicsPath CizimYeri.AddEllipse(85, 50, 250, 150) CizimYeri.AddEllipse(135, 0, 150, 250) Me.Region = New Region(CizimYeri) Panel1.BackColor = Color.Cyan NormalFrmTsmn.Enabled = True DaireTSmn.Enabled = True KalpTSmn.Enabled = True ElipsTSmn.Enabled = False End Sub Private Sub KalpTSmn_Click(sender As System.Object, e As System.EventArgs) Handles KalpTSmn.Click Dim CizimYeri As New Drawing2D.GraphicsPath CizimYeri.AddArc(70, 10, 150, 150, 135, 195) CizimYeri.AddArc(200, 10, 150, 150, 210, 195) CizimYeri.AddLine(92, 139, 210, 270) CizimYeri.AddLine(327, 139, 210, 270) CizimYeri.AddLine(327, 139, 92, 139) Me.Region = New Region(CizimYeri) Panel1.BackColor = Color.Red NormalFrmTsmn.Enabled = True DaireTSmn.Enabled = True KalpTSmn.Enabled = False ElipsTSmn.Enabled = True End Sub Private Sub DaireTSmn_Click(sender As System.Object, e As System.EventArgs) Handles DaireTSmn.Click Dim CizimYeri As New Drawing2D.GraphicsPath CizimYeri.AddEllipse(85, 0, 250, 250) Me.Region = New Region(CizimYeri) Panel1.BackColor = Color.Gold NormalFrmTsmn.Enabled = True DaireTSmn.Enabled = False KalpTSmn.Enabled = True ElipsTSmn.Enabled = True End Sub Private Sub Panel1_MouseUp(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp If e.Button = Windows.Forms.MouseButtons.Right Then Label1.Hide() Label2.Hide() ContextMenuStrip1.Show() End If End Sub Private Sub cikisTSmn_Click(sender As System.Object, e As System.EventArgs) Handles cikisTSmn.Click Me.Close() End Sub Private Sub NormalFrmTsmn_Click(sender As System.Object, e As System.EventArgs) Handles NormalFrmTsmn.Click Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None Label1.Visible = True Label2.Visible = True NormalFrmTsmn.Enabled = False DaireTSmn.Enabled = True KalpTSmn.Enabled = True ElipsTSmn.Enabled = True Panel1.BackColor = Color.Red End Sub End Class
Sonraki Kayıt
Önceki Kayıt
Ana Sayfa