Editbox portion of ComboBox gets selected automatically

后端 未结 7 1282
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 02:49

I have a small problem that has been annoying me for some hours.

In my WinForms (.NET 3.5) application I create some ComboBoxes (DropDownStyle = DropDown) in a Table

7条回答
  •  孤独总比滥情好
    2020-12-30 03:16

    Handle the Resize event for the ComboBox's parent container. Put this line in there:

    MyComboBox.SelectionLength = 0

    An Example (VB, obviously):

    Private Sub MyControl_Resize(sender As Object, e As EventArgs) Handles Me.Resize
    
        MyComboBox.SelectionLength = 0
    
    End Sub
    

    Good Luck to you!

    --BP

提交回复
热议问题