<?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%2FGUI%2FButton</id>
		<title>VB.Net/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%2FGUI%2FButton"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/GUI/Button&amp;action=history"/>
		<updated>2026-04-05T12:14:28Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/GUI/Button&amp;diff=478&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/GUI/Button&amp;diff=478&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:06Z</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/GUI/Button&amp;diff=479&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/GUI/Button&amp;diff=479&amp;oldid=prev"/>
				<updated>2010-05-26T12:43:16Z</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 a Button to Frame Dynamically==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Globalization&lt;br /&gt;
Imports System.Text&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New Form1()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    &amp;quot; Declare the btnHi button WithEvents.&lt;br /&gt;
    Private WithEvents buttonHi As Button&lt;br /&gt;
    &amp;quot; Make the new buttonHi button.&lt;br /&gt;
    Private Sub btnMakeHiButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMakeHiButton.Click&lt;br /&gt;
        buttonHi = New Button&lt;br /&gt;
        buttonHi.SetBounds(96, 50, 75, 23)&lt;br /&gt;
        buttonHi.Text = &amp;quot;Say Hi&amp;quot;&lt;br /&gt;
        Me.Controls.Add(buttonHi)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot; The user clicked the buttonHi button.&lt;br /&gt;
    Private Sub buttonHi_Click(ByVal sender As Object, _&lt;br /&gt;
     ByVal e As System.EventArgs) Handles buttonHi.Click&lt;br /&gt;
        MessageBox.Show(&amp;quot;Hi&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub btnRemoveHiButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRemoveHiButton.Click&lt;br /&gt;
        Me.Controls.Remove(buttonHi)&lt;br /&gt;
        buttonHi = Nothing&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 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.btnMakeHiButton = New System.Windows.Forms.Button&lt;br /&gt;
        Me.btnRemoveHiButton = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;btnMakeHiButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.btnMakeHiButton.Location = New System.Drawing.Point(8, 8)&lt;br /&gt;
        Me.btnMakeHiButton.Name = &amp;quot;btnMakeHiButton&amp;quot;&lt;br /&gt;
        Me.btnMakeHiButton.Size = New System.Drawing.Size(112, 23)&lt;br /&gt;
        Me.btnMakeHiButton.TabIndex = 0&lt;br /&gt;
        Me.btnMakeHiButton.Text = &amp;quot;Make Hi Button&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;btnRemoveHiButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.btnRemoveHiButton.Location = New System.Drawing.Point(144, 8)&lt;br /&gt;
        Me.btnRemoveHiButton.Name = &amp;quot;btnRemoveHiButton&amp;quot;&lt;br /&gt;
        Me.btnRemoveHiButton.Size = New System.Drawing.Size(112, 23)&lt;br /&gt;
        Me.btnRemoveHiButton.TabIndex = 1&lt;br /&gt;
        Me.btnRemoveHiButton.Text = &amp;quot;Remove Hi Button&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(292, 273)&lt;br /&gt;
        Me.Controls.Add(Me.btnRemoveHiButton)&lt;br /&gt;
        Me.Controls.Add(Me.btnMakeHiButton)&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 btnMakeHiButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents btnRemoveHiButton As System.Windows.Forms.Button&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Button Paint Event ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    &lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        &lt;br /&gt;
        Dim myform As Form = New OwnerDrawnButton()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&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&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Change Button Font at Runtime==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.IO&lt;br /&gt;
Imports System.Xml.Serialization&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Drawing.Text&lt;br /&gt;
Imports System.Drawing.Printing&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
       Dim form1 As Form = New Form1()&lt;br /&gt;
       Application.Run(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;
#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 Button1 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.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(72, 104)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(184, 48)&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Click me to change my font&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(6, 15)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(328, 168)&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;Changing the font on the button&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;
        Dim myFont As System.Drawing.Font&lt;br /&gt;
        myFont = New System.Drawing.Font(&amp;quot;Arial&amp;quot;, 12,FontStyle.Bold Or FontStyle.Italic)&lt;br /&gt;
        Me.Font = myFont&lt;br /&gt;
        Button1.Text = &amp;quot;My font was changed to this&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set button background==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Drawing&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Imports System.ruponentModel&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Imports System.Data&lt;br /&gt;
Imports System.Configuration&lt;br /&gt;
Imports System.Resources&lt;br /&gt;
&lt;br /&gt;
Public Class OptionsDialog&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 okButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents changeColorButton As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents errorProvider1 As System.Windows.Forms.ErrorProvider&lt;br /&gt;
    Friend WithEvents colorDialog1 As System.Windows.Forms.ColorDialog&lt;br /&gt;
    Friend WithEvents _cancelButton As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.okButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.changeColorButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me._cancelButton = New System.Windows.Forms.Button()&lt;br /&gt;
        Me.label1 = New System.Windows.Forms.Label()&lt;br /&gt;
        Me.errorProvider1 = New System.Windows.Forms.ErrorProvider()&lt;br /&gt;
        Me.colorDialog1 = New System.Windows.Forms.ColorDialog()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;okButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.okButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)&lt;br /&gt;
        Me.okButton.DialogResult = System.Windows.Forms.DialogResult.OK&lt;br /&gt;
        Me.okButton.Location = New System.Drawing.Point(32, 64)&lt;br /&gt;
        Me.okButton.Name = &amp;quot;okButton&amp;quot;&lt;br /&gt;
        Me.okButton.TabIndex = 5&lt;br /&gt;
        Me.okButton.Text = &amp;quot;OK&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;changeColorButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.changeColorButton.Location = New System.Drawing.Point(120, 8)&lt;br /&gt;
        Me.changeColorButton.Name = &amp;quot;changeColorButton&amp;quot;&lt;br /&gt;
        Me.changeColorButton.TabIndex = 4&lt;br /&gt;
        Me.changeColorButton.Text = &amp;quot;Change...&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;_cancelButton&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me._cancelButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)&lt;br /&gt;
        Me._cancelButton.CausesValidation = False&lt;br /&gt;
        Me._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel&lt;br /&gt;
        Me._cancelButton.Location = New System.Drawing.Point(120, 64)&lt;br /&gt;
        Me._cancelButton.Name = &amp;quot;_cancelButton&amp;quot;&lt;br /&gt;
        Me._cancelButton.TabIndex = 6&lt;br /&gt;
        Me._cancelButton.Text = &amp;quot;Cancel&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.label1.Location = New System.Drawing.Point(8, 8)&lt;br /&gt;
        Me.label1.Name = &amp;quot;label1&amp;quot;&lt;br /&gt;
        Me.label1.TabIndex = 3&lt;br /&gt;
        Me.label1.Text = &amp;quot;Favorite Color&amp;quot;&lt;br /&gt;
        Me.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;errorProvider1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.errorProvider1.DataMember = Nothing&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;OptionsDialog&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(208, 102)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me._cancelButton, Me.label1, Me.okButton, Me.changeColorButton})&lt;br /&gt;
        Me.Name = &amp;quot;OptionsDialog&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;OptionsDialog&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub changeColorButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles changeColorButton.Click&lt;br /&gt;
        If colorDialog1.ShowDialog() = DialogResult.OK Then&lt;br /&gt;
            changeColorButton.BackColor = colorDialog1.Color&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
    Public Property FavoriteColor() As Color&lt;br /&gt;
        Get&lt;br /&gt;
            Return colorDialog1.Color&lt;br /&gt;
        End Get&lt;br /&gt;
        Set(ByVal Value As Color)&lt;br /&gt;
            changeColorButton.BackColor = Value&lt;br /&gt;
            colorDialog1.Color = Value&lt;br /&gt;
        End Set&lt;br /&gt;
    End Property&lt;br /&gt;
    Private Sub cancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _cancelButton.Click&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New OptionsDialog()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Simple Button action==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
Class MyFirstForm&lt;br /&gt;
    Inherits Form&lt;br /&gt;
    Private WithEvents mybutton As Button&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        Me.Text = &amp;quot;Hello, WinForms!&amp;quot;&lt;br /&gt;
        mybutton = New Button()&lt;br /&gt;
        mybutton.Text = &amp;quot;Click Me!&amp;quot;&lt;br /&gt;
        Me.Controls.Add(mybutton)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Public Sub mybutton_Click(sender As Object, e As EventArgs) Handles mybutton.Click&lt;br /&gt;
        MessageBox.Show(&amp;quot;Message&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
        Dim myform As Form = New MyFirstForm()&lt;br /&gt;
        Application.Run(myform)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Simple Button Click action==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
&lt;br /&gt;
Module Module1&lt;br /&gt;
    Sub Main()&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Module&lt;br /&gt;
&lt;br /&gt;
&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 RichTextBox1 As System.Windows.Forms.RichTextBox&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.RichTextBox1 = New System.Windows.Forms.RichTextBox()&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(120, 272)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.TabIndex = 1&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;RichTextBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.RichTextBox1.Location = New System.Drawing.Point(32, 24)&lt;br /&gt;
        Me.RichTextBox1.Name = &amp;quot;RichTextBox1&amp;quot;&lt;br /&gt;
        Me.RichTextBox1.Size = New System.Drawing.Size(264, 232)&lt;br /&gt;
        Me.RichTextBox1.TabIndex = 2&lt;br /&gt;
        Me.RichTextBox1.Text = &amp;quot;&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, 309)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.RichTextBox1, Me.Button1})&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;ButtonDemo&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        MessageBox.Show(&amp;quot;clicked&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>