ComboBox Woes UserPageVisits:256 active 80 80 DaniWeb 561 60 2013-02-27T14:59:25+00:00 https://www.daniweb.com/programming/software-development/code/448862/combobox-woes

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
code snippet
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