Click here to Skip to main content
15,898,035 members
Articles / Programming Languages / XML

Flexible ComboBox and EditingControl

Rate me:
Please Sign up or sign in to vote.
4.80/5 (10 votes)
30 Apr 2012CPOL6 min read 54K   5.7K   37  
Using any Control In ComboBox or in EditingControl for DataGridView
Imports System.Drawing
Imports System.ComponentModel
Imports System.Windows.Forms.Design
Imports System.Drawing.Design
Imports System.Windows.Forms

<ToolboxItem(True), DefaultProperty("DropDownButton")> _
Public Class DropDownCombo
    Inherits TextBox
    Implements IHasDropDownButton

    Private _DropDownButton As DropDownButton

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
    Public ReadOnly Property DropDownButton As DropDownButton Implements IHasDropDownButton.DropDownButton
        Get
            Return _DropDownButton
        End Get
    End Property

    Public Sub New()
        Try
            _DropDownButton = New DropDownButton
            Me.Controls.Add(_DropDownButton)
            DropDownButton.Dock = DockStyle.Right
            DropDownButton.DisplayArea = Me
        Catch ex As Exception
            ErrMsg(ex)
        End Try
    End Sub

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Lebanon Lebanon
ASP.Net Hosting on Linux server
---------------------------
There is a developer behind every piece of code!
DNA is too complex what about it!
No junk DNA; There is a functional role for noncoding DNA

Comments and Discussions