Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Flatten that Combobox!

, 2 Feb 2003
A flat style combobox in VB.NET
flatcombotestharness.zip
FlatComboTestHarness.exe
flatten_that_combobox_sourcecode.zip
FlatComboTestHarness.vbproj.user
flat_sample1.zip
FlatCombobox2.exe
FlatCombobox2.pdb
flat_src1.zip
FlatCombobox2.suo
FlatCombobox2.vbproj.user
Public Class Form1
    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

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    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 MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
    Friend WithEvents ComboBox1 As FlatCombo
    Friend WithEvents FlatCombo1 As FlatCombo
    Friend WithEvents FlatCombo2 As FlatCombo
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.MainMenu1 = New System.Windows.Forms.MainMenu()
        Me.ColorDialog1 = New System.Windows.Forms.ColorDialog()
        Me.ComboBox1 = New FlatCombobox2.FlatCombo()
        Me.FlatCombo1 = New FlatCombobox2.FlatCombo()
        Me.FlatCombo2 = New FlatCombobox2.FlatCombo()
        Me.SuspendLayout()
        '
        'ComboBox1
        '
        Me.ComboBox1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(192, Byte), CType(192, Byte))
        Me.ComboBox1.ButtonColor = System.Drawing.Color.Firebrick
        Me.ComboBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ComboBox1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8", "9"})
        Me.ComboBox1.Location = New System.Drawing.Point(8, 8)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(176, 21)
        Me.ComboBox1.TabIndex = 4
        Me.ComboBox1.Text = "Get Colorfull"
        '
        'FlatCombo1
        '
        Me.FlatCombo1.BackColor = System.Drawing.Color.Brown
        Me.FlatCombo1.ButtonColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(0, Byte))
        Me.FlatCombo1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FlatCombo1.ForeColor = System.Drawing.Color.White
        Me.FlatCombo1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8", "9"})
        Me.FlatCombo1.Location = New System.Drawing.Point(8, 40)
        Me.FlatCombo1.Name = "FlatCombo1"
        Me.FlatCombo1.Size = New System.Drawing.Size(176, 21)
        Me.FlatCombo1.TabIndex = 5
        Me.FlatCombo1.Text = "If you want to"
        '
        'FlatCombo2
        '
        Me.FlatCombo2.ButtonColor = System.Drawing.SystemColors.Control
        Me.FlatCombo2.Items.AddRange(New Object() {"Or just accept", "the default system", "colors for the control"})
        Me.FlatCombo2.Location = New System.Drawing.Point(8, 72)
        Me.FlatCombo2.Name = "FlatCombo2"
        Me.FlatCombo2.Size = New System.Drawing.Size(176, 21)
        Me.FlatCombo2.TabIndex = 6
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(192, 141)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.FlatCombo2, Me.FlatCombo1, Me.ComboBox1})
        Me.Menu = Me.MainMenu1
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

IbanezPlayer
Web Developer
Malaysia Malaysia
As an experienced programmer, I know how hard it is to find good code sometimes. I hope my articles and samples are as good for you as they are for me. Need more good code? Email me.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 3 Feb 2003
Article Copyright 2002 by IbanezPlayer
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid