Click here to Skip to main content
13,004,188 members (78,324 online)
Click here to Skip to main content


25 bookmarked
Posted 13 Jun 2002

Flatten that Combobox!

, 2 Feb 2003
A flat style combobox in VB.NET
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()

        'This call is required by the Windows Form Designer.

        '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
            End If
        End If
    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.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"
        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"
        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
        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"

    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.


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


About the Author

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.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170627.1 | Last Updated 3 Feb 2003
Article Copyright 2002 by IbanezPlayer
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid