0

I have a form (vb.net, VS2010) which retrieves product orders and displays the result to a datagridview and text fields. I also have a combo box which displays a list of all products in a product file. I need to set the displayed text of the combo box to match the product name of the ordered product.
When I try to set it as below, all the products in the product list are displayed as one string in the combo box.

Private Sub tbProductName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbProductName.TextChanged
        combProductName2.SelectedText = CType(tbProductName.Text, String)
    End Sub
3
Contributors
2
Replies
8
Views
6 Years
Discussion Span
Last Post by poojashah623
0

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

For i = 0 To ComboBox1.Items.Count - 1
If UCase(ComboBox1.Items.Item(i).ToString) Like UCase(TextBox1.Text) & "*" Then
ListView1.Items.Add(ComboBox1.Items(i).ToString)
End If
Next

Hope this helps you...
End Sub

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.