<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGUI%2FButton</id>
		<title>VB.Net Tutorial/GUI/Button - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGUI%2FButton"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/Button&amp;action=history"/>
		<updated>2026-04-05T07:48:36Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/Button&amp;diff=3832&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/Button&amp;diff=3832&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/Button&amp;diff=3833&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/Button&amp;diff=3833&amp;oldid=prev"/>
				<updated>2010-05-26T12:57:02Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Add Button to a form and attach event handler==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class AddButtonAndAddEventHandler&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private Sub ShowTheTime(ByVal sender As System.Object, ByVal e As System.EventArgs)&lt;br /&gt;
            Console.WriteLine( Now.ToLongTimeString())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;
        Dim dynamicButton As Button&lt;br /&gt;
        dynamicButton = New Windows.Forms.Button&lt;br /&gt;
        dynamicButton.Location = New System.Drawing.Point(144, 32)&lt;br /&gt;
        dynamicButton.Size = New System.Drawing.Size(99, 23)&lt;br /&gt;
        dynamicButton.Text = &amp;quot;Get Time&amp;quot;&lt;br /&gt;
        dynamicButton.UseVisualStyleBackColor = True&lt;br /&gt;
        dynamicButton.TabIndex = 1&lt;br /&gt;
        Me.Controls.Add(dynamicButton)&lt;br /&gt;
        &amp;quot; ----- Connect the button to an event handler.&lt;br /&gt;
        AddHandler dynamicButton.Click, AddressOf ShowTheTime&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(260, 76)&lt;br /&gt;
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle&lt;br /&gt;
        Me.MaximizeBox = False&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Dynamic Controls&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button Anchor==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class ButtonAnchor&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Button1.Location = New System.Drawing.Point( _&lt;br /&gt;
            Me.ClientRectangle.Width - Button1.Width, _&lt;br /&gt;
            Me.ClientRectangle.Height - Button1.Height)&lt;br /&gt;
        Button1.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(24, 24)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(75, 23)&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(185, 84)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button click event==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class GetTextPasswordField&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New FrmButtonTest)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class FrmButtonTest&lt;br /&gt;
   Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
   Public Sub New()&lt;br /&gt;
      MyBase.New()&lt;br /&gt;
      &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
      InitializeComponent()&lt;br /&gt;
      &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
   End Sub&lt;br /&gt;
   &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
   Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
      If disposing Then&lt;br /&gt;
         If Not (components Is Nothing) Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
         End If&lt;br /&gt;
      End If&lt;br /&gt;
      MyBase.Dispose(disposing)&lt;br /&gt;
   End Sub&lt;br /&gt;
   Friend WithEvents lblOutput As System.Windows.Forms.Label&lt;br /&gt;
   Friend WithEvents txtInput As System.Windows.Forms.TextBox&lt;br /&gt;
   Friend WithEvents cmdShow As System.Windows.Forms.Button&lt;br /&gt;
   &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
   Private components As System.ruponentModel.Container&lt;br /&gt;
   &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
   &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
   &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
   &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
      Me.cmdShow = New System.Windows.Forms.Button()&lt;br /&gt;
      Me.txtInput = New System.Windows.Forms.TextBox()&lt;br /&gt;
      Me.lblOutput = New System.Windows.Forms.Label()&lt;br /&gt;
      Me.SuspendLayout()&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      &amp;quot;cmdShow&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      Me.cmdShow.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
      Me.cmdShow.Location = New System.Drawing.Point(88, 88)&lt;br /&gt;
      Me.cmdShow.Name = &amp;quot;cmdShow&amp;quot;&lt;br /&gt;
      Me.cmdShow.Size = New System.Drawing.Size(96, 40)&lt;br /&gt;
      Me.cmdShow.TabIndex = 2&lt;br /&gt;
      Me.cmdShow.Text = &amp;quot;Show Me&amp;quot;&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      &amp;quot;txtInput&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      Me.txtInput.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
      Me.txtInput.Location = New System.Drawing.Point(16, 16)&lt;br /&gt;
      Me.txtInput.Name = &amp;quot;txtInput&amp;quot;&lt;br /&gt;
      Me.txtInput.PasswordChar = Microsoft.VisualBasic.ChrW(42)&lt;br /&gt;
      Me.txtInput.Size = New System.Drawing.Size(232, 22)&lt;br /&gt;
      Me.txtInput.TabIndex = 0&lt;br /&gt;
      Me.txtInput.Text = &amp;quot;&amp;quot;&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      &amp;quot;lblOutput&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      Me.lblOutput.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
      Me.lblOutput.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
      Me.lblOutput.Location = New System.Drawing.Point(16, 56)&lt;br /&gt;
      Me.lblOutput.Name = &amp;quot;lblOutput&amp;quot;&lt;br /&gt;
      Me.lblOutput.Size = New System.Drawing.Size(232, 23)&lt;br /&gt;
      Me.lblOutput.TabIndex = 1&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      &amp;quot;FrmButtonTest&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
      Me.ClientSize = New System.Drawing.Size(264, 141)&lt;br /&gt;
      Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdShow, Me.lblOutput, Me.txtInput})&lt;br /&gt;
      Me.Name = &amp;quot;FrmButtonTest&amp;quot;&lt;br /&gt;
      Me.Text = &amp;quot;LabelTextBoxButtonExample&amp;quot;&lt;br /&gt;
      Me.ResumeLayout(False)&lt;br /&gt;
   End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
   Private Sub cmdShow_Click(ByVal sender As System.Object, _&lt;br /&gt;
      ByVal e As System.EventArgs) Handles cmdShow.Click&lt;br /&gt;
      lblOutput.Text = txtInput.Text&lt;br /&gt;
   End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button click event and text changed event==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class ButtonClickTextChanged&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(96, 72)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(280, 181)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button1})&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;EventDemo&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        MsgBox(&amp;quot;Click event occurred&amp;quot;)&lt;br /&gt;
        If (Button1.Text = &amp;quot;Button1&amp;quot;) Then&lt;br /&gt;
            Button1.Text = &amp;quot;Clicked&amp;quot;&lt;br /&gt;
        Else&lt;br /&gt;
            Button1.Text = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.TextChanged&lt;br /&gt;
        MsgBox(&amp;quot;Textchanged event occurred&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button FlatStyle==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;imports System&lt;br /&gt;
imports System.Drawing&lt;br /&gt;
imports System.Windows.Forms&lt;br /&gt;
public class ButtonFlatStyle : inherits Form&lt;br /&gt;
  dim btn as Button&lt;br /&gt;
  dim i as integer&lt;br /&gt;
  dim theStyles as FlatStyle()&lt;br /&gt;
  dim img as Image  = Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
  public sub New()&lt;br /&gt;
        Text = &amp;quot;Button Properties&amp;quot;&lt;br /&gt;
    Size = new Size(300,200)&lt;br /&gt;
    btn = new Button()&lt;br /&gt;
    btn.Parent = me&lt;br /&gt;
    btn.Text = btn.FlatStyle.ToString()&lt;br /&gt;
    btn.Location = new Point(10,10)&lt;br /&gt;
    btn.Size = new Size(200,100)&lt;br /&gt;
    btn.BackColor = Color.LightGreen&lt;br /&gt;
    AddHandler btn.Click, AddressOf btn_Click&lt;br /&gt;
    btn.Image = img&lt;br /&gt;
    btn.ImageAlign = ContentAlignment.MiddleRight&lt;br /&gt;
    btn.TextAlign = ContentAlignment.MiddleLeft&lt;br /&gt;
    dim theEnum as new FlatStyle()&lt;br /&gt;
    theStyles = CType([Enum].GetValues(theEnum.GetType()), FlatStyle())&lt;br /&gt;
  end sub&lt;br /&gt;
  public shared sub Main() &lt;br /&gt;
    Application.Run(new ButtonFlatStyle())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub btn_Click(ByVal sender as object, ByVal e as EventArgs)&lt;br /&gt;
    Dim btn as Button = CType(sender, Button)&lt;br /&gt;
    btn.FlatStyle = theStyles(i)&lt;br /&gt;
    btn.Text = btn.FlatStyle.ToString()&lt;br /&gt;
    if (i &amp;lt; theStyles.Length - 1) then&lt;br /&gt;
      i = i + 1&lt;br /&gt;
    else&lt;br /&gt;
      i = 0&lt;br /&gt;
    end if&lt;br /&gt;
  end sub&lt;br /&gt;
end class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button ImageList==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;imports System&lt;br /&gt;
imports System.Drawing&lt;br /&gt;
imports System.Windows.Forms&lt;br /&gt;
public class ButtonImageList : inherits Form&lt;br /&gt;
  dim imgList as ImageList = new ImageList()&lt;br /&gt;
    dim lbl as Label &lt;br /&gt;
    dim lnk as LinkLabel&lt;br /&gt;
    dim btn as Button&lt;br /&gt;
    dim nmbrUpDown as NumericUpDown&lt;br /&gt;
  public sub New()&lt;br /&gt;
       Size = new Size(300,300)&lt;br /&gt;
    dim img as Image&lt;br /&gt;
    dim i as integer&lt;br /&gt;
    dim arFiles as string() = {&amp;quot;1.ico&amp;quot;,&amp;quot;2.ico&amp;quot;,&amp;quot;3.ico&amp;quot;,&amp;quot;4.ico&amp;quot;}&lt;br /&gt;
    for i = 0 to arFiles.Length - 1&lt;br /&gt;
      img = Image.FromFile(arFiles(i))&lt;br /&gt;
      imgList.Images.Add(img)&lt;br /&gt;
    next&lt;br /&gt;
    btn = new Button()&lt;br /&gt;
    btn.Parent = me&lt;br /&gt;
    btn.ImageList = imgList&lt;br /&gt;
    btn.ImageIndex = imgList.Images.Count - 1&lt;br /&gt;
    btn.Location = new Point(0, 0)&lt;br /&gt;
    btn.Size = new Size(200,20)&lt;br /&gt;
    &amp;quot;  Create numeric updown to select the image&lt;br /&gt;
    nmbrUpDown = new NumericUpDown()&lt;br /&gt;
    nmbrUpDown.Parent = me&lt;br /&gt;
    nmbrUpDown.Location = new Point(0, 60)&lt;br /&gt;
    nmbrUpDown.Value = 0&lt;br /&gt;
    nmbrUpDown.Minimum = 0&lt;br /&gt;
    nmbrUpDown.Maximum = imgList.Images.Count - 1&lt;br /&gt;
    nmbrUpDown.Width = 50&lt;br /&gt;
    nmbrUpDown.ReadOnly = true&lt;br /&gt;
    AddHandler nmbrUpDown.ValueChanged,AddressOf nmbrUpDown_ValueChanged&lt;br /&gt;
    end sub&lt;br /&gt;
    public shared sub Main() &lt;br /&gt;
      Application.Run(new ButtonImageList())&lt;br /&gt;
    end sub&lt;br /&gt;
    private sub nmbrUpDown_ValueChanged(ByVal sender as object,ByVal e as EventArgs)&lt;br /&gt;
      dim n as NumericUpDown  = CType(sender, NumericUpDown)&lt;br /&gt;
    btn.ImageIndex = CType(n.Value, Integer)&lt;br /&gt;
    end sub&lt;br /&gt;
end class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button PerformClick==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class ButtonPerformClick&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Button2 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Button2 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(72, 80)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(184, 23)&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Click Me to Click the Other Button&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button2.Location = New System.Drawing.Point(72, 160)&lt;br /&gt;
        Me.Button2.Name = &amp;quot;Button2&amp;quot;&lt;br /&gt;
        Me.Button2.Size = New System.Drawing.Size(184, 23)&lt;br /&gt;
        Me.Button2.TabIndex = 1&lt;br /&gt;
        Me.Button2.Text = &amp;quot;The Other Button&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 14.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(328, 40)&lt;br /&gt;
        Me.Label1.TabIndex = 2&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Clicked&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(328, 273)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.Button2)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        Button2.PerformClick()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click&lt;br /&gt;
        Button2.Text = &amp;quot;I&amp;quot;ve been clicked!&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button Properties==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;imports System&lt;br /&gt;
imports System.Drawing&lt;br /&gt;
imports System.Windows.Forms&lt;br /&gt;
public class ButtonFlatStyle : inherits Form&lt;br /&gt;
  dim btn as Button&lt;br /&gt;
  dim i as integer&lt;br /&gt;
  dim theStyles as FlatStyle()&lt;br /&gt;
  dim img as Image  = Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
  public sub New()&lt;br /&gt;
        Text = &amp;quot;Button Properties&amp;quot;&lt;br /&gt;
    Size = new Size(300,200)&lt;br /&gt;
    btn = new Button()&lt;br /&gt;
    btn.Parent = me&lt;br /&gt;
    btn.Text = btn.FlatStyle.ToString()&lt;br /&gt;
    btn.Location = new Point(10,10)&lt;br /&gt;
    btn.Size = new Size(200,100)&lt;br /&gt;
    btn.BackColor = Color.LightGreen&lt;br /&gt;
    AddHandler btn.Click, AddressOf btn_Click&lt;br /&gt;
    btn.Image = img&lt;br /&gt;
    btn.ImageAlign = ContentAlignment.MiddleRight&lt;br /&gt;
    btn.TextAlign = ContentAlignment.MiddleLeft&lt;br /&gt;
    dim theEnum as new FlatStyle()&lt;br /&gt;
    theStyles = CType([Enum].GetValues(theEnum.GetType()), FlatStyle())&lt;br /&gt;
  end sub&lt;br /&gt;
  public shared sub Main() &lt;br /&gt;
    Application.Run(new ButtonFlatStyle())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub btn_Click(ByVal sender as object, ByVal e as EventArgs)&lt;br /&gt;
    Dim btn as Button = CType(sender, Button)&lt;br /&gt;
    btn.FlatStyle = theStyles(i)&lt;br /&gt;
    btn.Text = btn.FlatStyle.ToString()&lt;br /&gt;
    if (i &amp;lt; theStyles.Length - 1) then&lt;br /&gt;
      i = i + 1&lt;br /&gt;
    else&lt;br /&gt;
      i = 0&lt;br /&gt;
    end if&lt;br /&gt;
  end sub&lt;br /&gt;
end class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Button with background image==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class ButtonBackgroundImage&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.TextBox1 = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.BackgroundImage = System.Drawing.Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(8, 64)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(368, 20)&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TextBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TextBox1.Location = New System.Drawing.Point(104, 184)&lt;br /&gt;
        Me.TextBox1.Name = &amp;quot;TextBox1&amp;quot;&lt;br /&gt;
        Me.TextBox1.Size = New System.Drawing.Size(168, 20)&lt;br /&gt;
        Me.TextBox1.TabIndex = 1&lt;br /&gt;
        Me.TextBox1.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.Font = New System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(232, 48)&lt;br /&gt;
        Me.Label1.TabIndex = 2&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Image Buttons&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(384, 229)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.TextBox1)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        TextBox1.Text = &amp;quot;You clicked the button.&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Irregular shape of Button==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class IrregularShapeButton&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Private originalSize As Size&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents AnimationBtn As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents VideoBtn As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents AudioBtn As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu&lt;br /&gt;
    Friend WithEvents Circlemenu As System.Windows.Forms.MenuItem&lt;br /&gt;
    Friend WithEvents RectMenu As System.Windows.Forms.MenuItem&lt;br /&gt;
    Friend WithEvents TriangleMenu As System.Windows.Forms.MenuItem&lt;br /&gt;
    Friend WithEvents CloseMenu As System.Windows.Forms.MenuItem&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.AnimationBtn = New System.Windows.Forms.Button&lt;br /&gt;
        Me.VideoBtn = New System.Windows.Forms.Button&lt;br /&gt;
        Me.AudioBtn = New System.Windows.Forms.Button&lt;br /&gt;
        Me.ContextMenu1 = New System.Windows.Forms.ContextMenu&lt;br /&gt;
        Me.Circlemenu = New System.Windows.Forms.MenuItem&lt;br /&gt;
        Me.RectMenu = New System.Windows.Forms.MenuItem&lt;br /&gt;
        Me.TriangleMenu = New System.Windows.Forms.MenuItem&lt;br /&gt;
        Me.CloseMenu = New System.Windows.Forms.MenuItem&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;AnimationBtn&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AnimationBtn.BackColor = System.Drawing.Color.Blue&lt;br /&gt;
        Me.AnimationBtn.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 10.0!, System.Drawing.FontStyle.Bold)&lt;br /&gt;
        Me.AnimationBtn.ForeColor = System.Drawing.SystemColors.ControlLightLight&lt;br /&gt;
        Me.AnimationBtn.Location = New System.Drawing.Point(120, 146)&lt;br /&gt;
        Me.AnimationBtn.Name = &amp;quot;AnimationBtn&amp;quot;&lt;br /&gt;
        Me.AnimationBtn.Size = New System.Drawing.Size(152, 104)&lt;br /&gt;
        Me.AnimationBtn.TabIndex = 6&lt;br /&gt;
        Me.AnimationBtn.Text = &amp;quot;Animation&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;VideoBtn&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.VideoBtn.BackColor = System.Drawing.Color.Green&lt;br /&gt;
        Me.VideoBtn.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 10.0!, System.Drawing.FontStyle.Bold)&lt;br /&gt;
        Me.VideoBtn.ForeColor = System.Drawing.SystemColors.ControlLightLight&lt;br /&gt;
        Me.VideoBtn.Location = New System.Drawing.Point(208, 26)&lt;br /&gt;
        Me.VideoBtn.Name = &amp;quot;VideoBtn&amp;quot;&lt;br /&gt;
        Me.VideoBtn.Size = New System.Drawing.Size(160, 96)&lt;br /&gt;
        Me.VideoBtn.TabIndex = 5&lt;br /&gt;
        Me.VideoBtn.Text = &amp;quot;Play Video&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;AudioBtn&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AudioBtn.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte))&lt;br /&gt;
        Me.AudioBtn.Font = New System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 10.0!, System.Drawing.FontStyle.Bold)&lt;br /&gt;
        Me.AudioBtn.ForeColor = System.Drawing.SystemColors.ControlLightLight&lt;br /&gt;
        Me.AudioBtn.Location = New System.Drawing.Point(96, 26)&lt;br /&gt;
        Me.AudioBtn.Name = &amp;quot;AudioBtn&amp;quot;&lt;br /&gt;
        Me.AudioBtn.Size = New System.Drawing.Size(160, 96)&lt;br /&gt;
        Me.AudioBtn.TabIndex = 4&lt;br /&gt;
        Me.AudioBtn.Text = &amp;quot;Play Audio&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;ContextMenu1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.Circlemenu, Me.RectMenu, Me.TriangleMenu, Me.CloseMenu})&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Circlemenu&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Circlemenu.Index = 0&lt;br /&gt;
        Me.Circlemenu.Text = &amp;quot;Circle&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RectMenu&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RectMenu.Index = 1&lt;br /&gt;
        Me.RectMenu.Text = &amp;quot;Original&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TriangleMenu&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TriangleMenu.Index = 2&lt;br /&gt;
        Me.TriangleMenu.Text = &amp;quot;TriangleMenu&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;CloseMenu&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.CloseMenu.Index = 3&lt;br /&gt;
        Me.CloseMenu.Text = &amp;quot;Close&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(464, 277)&lt;br /&gt;
        Me.Controls.Add(Me.AnimationBtn)&lt;br /&gt;
        Me.Controls.Add(Me.VideoBtn)&lt;br /&gt;
        Me.Controls.Add(Me.AudioBtn)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        originalSize = Me.Size&lt;br /&gt;
        Dim path1 As New GraphicsPath(FillMode.Alternate)&lt;br /&gt;
        path1.AddEllipse(New Rectangle(30, 30, AudioBtn.Width - 60, AudioBtn.Height - 60))&lt;br /&gt;
        AudioBtn.Region = New [Region](path1)&lt;br /&gt;
        Dim path2 As New GraphicsPath(FillMode.Alternate)&lt;br /&gt;
        path2.AddEllipse(New Rectangle(30, 30, VideoBtn.Width - 60, VideoBtn.Height - 60))&lt;br /&gt;
        VideoBtn.Region = New [Region](path2)&lt;br /&gt;
        Dim path3 As New GraphicsPath(FillMode.Alternate)&lt;br /&gt;
        path3.AddEllipse(New Rectangle(20, 20, VideoBtn.Width - 40, VideoBtn.Height - 40))&lt;br /&gt;
        AnimationBtn.Region = New [Region](path3)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub AudioBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AudioBtn.Click&lt;br /&gt;
        MessageBox.Show(&amp;quot;Play Audio Button clicked!&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub VideoBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VideoBtn.Click&lt;br /&gt;
        MessageBox.Show(&amp;quot;Play Video Button clicked!&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub AnimationBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnimationBtn.Click&lt;br /&gt;
        MessageBox.Show(&amp;quot;Play Animation Button clicked!&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Owner draw button==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Public Class OwnerDrawnButton&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents button4 As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.button4 = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;button4&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.button4.Location = New System.Drawing.Point(40, 35)&lt;br /&gt;
        Me.button4.Name = &amp;quot;button4&amp;quot;&lt;br /&gt;
        Me.button4.Size = New System.Drawing.Size(200, 40)&lt;br /&gt;
        Me.button4.TabIndex = 2&lt;br /&gt;
        Me.button4.Text = &amp;quot;button4&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;OwnerDrawnButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(280, 110)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.button4})&lt;br /&gt;
        Me.Name = &amp;quot;OwnerDrawnButton&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;OwnerDrawnButton&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub button4_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles button4.Paint&lt;br /&gt;
        Dim pen As Pen = New Pen(Color.Red, 2)&lt;br /&gt;
        e.Graphics.DrawRectangle(pen, 5, 5, button4.Width - 10, button4.Height - 10)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>