edit items in combobox

  • Thread starter Thread starter tupolev
  • Start date Start date
T

tupolev

Hello,

I want allow the user to edit the items but the only thing I found is to
delete and insert items. Is there a way how you can do that?
I tried combobox.selecteditem=combobox.text --> runtime error: no string
And in what event should I do this, I tried the textchanged event but this
take only the first changedletter.

Greatings Tupolev
 
I still have a problem with this: when I change the item then he set the
selectedindex back to -1, even when I tried to set the selectedindex to the
item. My code sofar:
contactlijst is a structure and the volgnummer is the index of the item in
the combobox

If combobox.SelectedIndex > -1 Then

Dim i As Integer

For i = 0 To contactlijst.Length - 1

If (combobox.Text <> "") And (contactlijst(i).volgnummer =
ddlnaam.SelectedIndex) Then

If combobox.Text <> contactlijst(i).contactnaam Then

contactlijst(i).gewijzigd = True

contactlijst(i).contactnaam = combobox.Text

combobox.Items.Insert(contactlijst(i).volgnummer,
contactlijst(i).contactnaam)

combobox.Items.RemoveAt(contactlijst(i).volgnummer + 1)

combobox.SelectedIndex = contactlijst(i).volgnummer

combobox.Text = combobox.Items.Item(contactlijst(i).volgnummer).ToString

Exit Sub

End If

End If

Next

End If

What 's wrong???????????????
 
Back
Top