bestehende Funktion überschreiben/neuer Handler

' Handler der Listbox hinzufügen
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  AddHandler ListBox1.SelectedValueChanged, AddressOf ListBox1_SelectedValueChanged
End Sub

' neuer Handler für ListBox1_SelectedValueChanged
Private Sub ListBox1_SelectedValueChanged(sender As Object, e As EventArgs)
  If ListBox1.SelectedIndex <> - 1 Then
     textBox1.Text = ListBox1.SelectedValue.ToString()
  End If
End Sub

Schreibe einen Kommentar