title: How to update a Label's text when changing the SelectedIndex property of a ComboBox control?
body: <p>What I want to do here is that for every new item added into the <code>ComboBox</code>, a Label's text property will display +1 from the previous number.</p>
  
  <p>How do I write it out, assuming I didn't assign the items a number.</p>
  
  <pre><code>Items              Label
  Tom                 1
  Jane                2
  Mary                3
  John                4
  etc..               etc..
  </code></pre>
  
  <p>Edit: My <code>ComboBox</code> is binded to a data source.</p>
  
  <pre><code>Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
  
      Dim studentcheck = StudentTableAdapter.checkstudent(StudentNameTextBox.Text, StudentAddressTextBox.Text)
  
      If StudentNameTextBox.Text.Length = 0 Then
  
          MsgBox("Name is Empty")
  
      ElseIf StudentAddressTextBox.Text.Length = 0 Then
  
          MsgBox("Address is empty")
  
      ElseIf studentcheck Is Nothing Then
  
          Me.Validate()
          Me.StudentBindingSource.EndEdit()
          Me.TableAdapterManager.UpdateAll(Me.LibraryDataSet)
          frmAddLoan.DisplayLoanTableAdapter.Fill(frmAddLoan.LibraryDataSet.DisplayLoan)
          frmAddLoan.ComboBox1.Update()
          MsgBox("Student Info Added")
  
      Else
  
          MsgBox("Student Name and Address have been used.")
  
      End If
  
  End Sub
  </code></pre>