ComboBox Woes

Begginnerdev

Upon resizing an anchored combobox - I noticed the text was always selected.
This sparked the initiative to fix this problem. (Microsoft decided not to)

So by extending the combobox class we can fix this.

The following class can be dropped into a form for designer manipulation or as a user control.

This is an extremely simple fix.

TnTinMN commented: So I'm not the only one to find that iirritating! That dang edit control box! textbox control! +7
JorgeM commented: nice. +12
256 Views
About the Author
Public Class ExtendedComboBox
    Inherits ComboBox

    Sub Me_Resize(sender As Object, e As EventArgs) Handles Me.Resize
        If Not Me.Focused Then Me.SelectionLength = 0
    End Sub
End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.