Results 1 to 7 of 7

Thread: ComboBox SelectionChangedCommitted + Setting Focus = Problem

Threaded View

  1. #5
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    313

    Re: ComboBox SelectionChangedCommitted + Setting Focus = Problem

    Something I found, maybe it could help:

    http://support.microsoft.com/kb/2868238/en-us

    EDIT:

    After applying the fix this works fine for me:

    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    4.         Dim dt As New DataTable("Teste")
    5.  
    6.         dt.Columns.Add("ValueColumn", GetType(Integer))
    7.         dt.Columns.Add("DisplayColumn", GetType(String))
    8.  
    9.         dt.Rows.Add(0, "111111")
    10.         dt.Rows.Add(1, "12341")
    11.         dt.Rows.Add(2, "34334")
    12.         dt.Rows.Add(3, "55555")
    13.         dt.Rows.Add(4, "55566")
    14.         dt.Rows.Add(5, "555676")
    15.         dt.Rows.Add(6, "88111")
    16.         dt.Rows.Add(7, "99911")
    17.  
    18.  
    19.         ComboBox1.DataSource = dt
    20.         ComboBox1.DisplayMember = "DisplayColumn"
    21.         ComboBox1.ValueMember = "ValueColumn"
    22.  
    23.         ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
    24.         ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems
    25.         ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
    26.  
    27.  
    28.  
    29.     End Sub
    30.  
    31.  
    32.  
    33.  
    34.  
    35.  
    36.     Private Sub ComboBox1_SelectionChangeCommitted(sender As Object, e As System.EventArgs) Handles ComboBox1.SelectionChangeCommitted
    37.         TextBox1.Text = ComboBox1.Text
    38.  
    39.         'aux = ComboBox1.SelectedIndex 'WorkAround
    40.         TextBox1.Focus()
    41.     End Sub
    Last edited by BlackRiver; Feb 5th, 2014 at 07:50 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width