Results 1 to 4 of 4

Thread: Toolstrip combobox select highlight

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Toolstrip combobox select highlight

    I have a toolstrip with a combobox. The Autocompletemode is set to "Suggest ". After the selectedindex is changed, I move to a different control. Like this,
    Code:
        Private Sub LastNameToolStripComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LastNameToolStripComboBox.SelectedIndexChanged
            Dim indexnumber As Integer = Me.ProducersBindingSource.Find("ProducerId", Me.LastNameToolStripComboBox.Text.Substring(75))
            If indexnumber = -1 Then
                MessageBox.Show("Last Name Name Not Found!")
            Else
                Me.ProducersBindingSource.Position = indexnumber
                Me.FirstNameTextBox.Select()
                Me.LastNameToolStripComboBox.Text = Me.LastNameToolStripComboBox.Text.Substring(0, 65)
            End If
        End Sub
    The issue is this, if I select from the drop down list, it works the way a want.
    But, if I type something and then select from the "Suggest" list that pops up, the text in the Toolstrip Combobox remains highlighted, (blue). I can't figure out how to deselect the text.

    Any information will be appriciated
    Last edited by Joacim Andersson; Apr 27th, 2013 at 12:13 AM. Reason: "Unresolved"

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Toolstrip combobox select highlight

    I can get you text that is never highlighted but that may not be what you want?

    vb.net Code:
    1. Private Sub ToolStripComboBox1_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles ToolStripComboBox1.Paint
    2.         ToolStripComboBox1.SelectionLength = 0
    3.     End Sub
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Re: Toolstrip combobox select highlight

    dunfiddlin,

    That will do the job just fine. Thanks, very helpful information.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Re: [RESOLVED] Toolstrip combobox select highlight

    I spoke to soon. This won''t allow you to highlight the text so you can type in a different name. I should have paid more attend to the word "never" in your post.

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