Developer, Former MVP, now at Microsoft - Best of 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged MessageBox.Show(ListBox1.SelectedItem.ToString())End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click ListBox1.SelectedIndex = 0End Sub
Private mDontRun As Boolean
mDontRun = TrueListBox1.SelectedIndex = 0mDontRun = False
If mDontRun = True Then Return
RemoveHandler ListBox1.SelectedIndexChanged, _ AddressOf ListBox1_SelectedIndexChangedListBox1.SelectedIndex = 0AddHandler ListBox1.SelectedIndexChanged, _ AddressOf ListBox1_SelectedIndexChanged