Button.BackColor : Button « System.Windows.Forms « VB.Net by API

Home
VB.Net by API
1.Microsoft.VisualBasic
2.Microsoft.Win32
3.System
4.System.Collections
5.System.Collections.Generic
6.System.Collections.Specialized
7.System.ComponentModel
8.System.Configuration.ConfigurationSettings
9.System.Data
10.System.Data.Odbc
11.System.Data.OleDb
12.System.Data.OracleClient
13.System.Data.SqlClient
14.System.Diagnostics
15.System.Drawing
16.System.Drawing.Drawing2D
17.System.Drawing.Imaging
18.System.Drawing.Printing
19.System.Drawing.Text
20.System.Globalization
21.System.IO
22.System.IO.IsolatedStorage
23.System.IO.Ports
24.System.Media
25.System.Messaging
26.System.Net
27.System.Net.Sockets
28.System.Reflection
29.System.Runtime.InteropServices
30.System.Runtime.Remoting.Channels
31.System.Runtime.Serialization
32.System.Runtime.Serialization.Formatters.Binary
33.System.Runtime.Serialization.Formatters.Soap
34.System.Security.Cryptography
35.System.Security.Cryptography.X509Certificates
36.System.Security.Permissions
37.System.Security.Principal
38.System.ServiceProcess
39.System.Text
40.System.Text.RegularExpressions
41.System.Threading
42.System.Web
43.System.Web.Mail
44.System.Windows.Forms
45.System.Xml
46.System.Xml.Schema
47.System.Xml.Serialization
48.System.Xml.Xsl
VB.Net
VB.Net Tutorial
VB.Net by API » System.Windows.Forms » Button 
Button.BackColor
  
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports System.Configuration
Imports System.Resources


Public Class OptionsDialog
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub


    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents okButton As System.Windows.Forms.Button
    Friend WithEvents changeColorButton As System.Windows.Forms.Button
    Friend WithEvents label1 As System.Windows.Forms.Label
    Friend WithEvents errorProvider1 As System.Windows.Forms.ErrorProvider
    Friend WithEvents colorDialog1 As System.Windows.Forms.ColorDialog
    Friend WithEvents _cancelButton As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()Private Sub InitializeComponent()
        Me.okButton = New System.Windows.Forms.Button()
        Me.changeColorButton = New System.Windows.Forms.Button()
        Me._cancelButton = New System.Windows.Forms.Button()
        Me.label1 = New System.Windows.Forms.Label()
        Me.errorProvider1 = New System.Windows.Forms.ErrorProvider()
        Me.colorDialog1 = New System.Windows.Forms.ColorDialog()
        Me.SuspendLayout()
        '
        'okButton
        '
        Me.okButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
        Me.okButton.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.okButton.Location = New System.Drawing.Point(3264)
        Me.okButton.Name = "okButton"
        Me.okButton.TabIndex = 5
        Me.okButton.Text = "OK"
        '
        'changeColorButton
        '
        Me.changeColorButton.Location = New System.Drawing.Point(1208)
        Me.changeColorButton.Name = "changeColorButton"
        Me.changeColorButton.TabIndex = 4
        Me.changeColorButton.Text = "Change..."
        '
        '_cancelButton
        '
        Me._cancelButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
        Me._cancelButton.CausesValidation = False
        Me._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me._cancelButton.Location = New System.Drawing.Point(12064)
        Me._cancelButton.Name = "_cancelButton"
        Me._cancelButton.TabIndex = 6
        Me._cancelButton.Text = "Cancel"
        '
        'label1
        '
        Me.label1.Location = New System.Drawing.Point(88)
        Me.label1.Name = "label1"
        Me.label1.TabIndex = 3
        Me.label1.Text = "Favorite Color"
        Me.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'errorProvider1
        '
        Me.errorProvider1.DataMember = Nothing
        '
        'OptionsDialog
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(513)
        Me.ClientSize = New System.Drawing.Size(208102)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me._cancelButton, Me.label1, Me.okButton, Me.changeColorButton})
        Me.Name = "OptionsDialog"
        Me.Text = "OptionsDialog"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub changeColorButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgsHandles changeColorButton.Click
        If colorDialog1.ShowDialog() = DialogResult.OK Then
            changeColorButton.BackColor = colorDialog1.Color
        End If
    End Sub

    Public Property FavoriteColor() As Color
        Get
            Return colorDialog1.Color
        End Get
        Set(ByVal Value As Color)
            changeColorButton.BackColor = Value
            colorDialog1.Color = Value
        End Set
    End Property

    Private Sub cancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgsHandles _cancelButton.Click

    End Sub

    Shared Sub Main()
        Dim myform As Form = New OptionsDialog()
        Application.Run(myform)
    End Sub

End Class

   
    
  
Related examples in the same category
1.Button.Anchor
2.Button.Click
3.Button.FlatStyle
4.Button.HasChildren
5.Button.Image
6.Button.ImageAlign
7.Button.ImageIndex
8.Button.ImageList
9.Button.LostFocus
10.Button.MouseDown
11.Button.MouseEnter
12.Button.MouseHover
13.Button.MouseLeave
14.Button.MouseUp
15.Button.Paint
16.Button.Parent
17.Button.PerformClick
18.Button.Region
19.Button.Text
20.Button.TextAlign
21.Button.TopLevelControl
22.Button.UseVisualStyleBackColor
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.