Hi,
I have VB.Net Windows forms code that's been running under
VS.Net 2002 for months and just now we are converting to
VS.Net 2003.
After the conversion, however, the following event handler
is broken:
Private Sub cmdLogin_Leave(ByVal sender As Object, ByVal e
As System.EventArgs) Handles cmdLogin.Leave
If TabControl1.SelectedIndex = 0 Then
TabControl1.SelectedTab = TabPage2
txtOPCD.Focus()
ElseIf TabControl1.SelectedIndex = 1 Then
TabControl1.SelectedTab = TabPage1
txtLogin.Focus()
End If
End Sub
As you can see, this is nothing more than a command
button's lost focus event handler that swith between two
tab pages and it worked fine until VS.Net 2003.
Now what happens is that, for some reason, the line
TabControl1.SelectedTab = TabPage2 and
TabControl1.SelectedTab = TabPage1 both fire up the
current event handler, cmdLogin_Leave. That causes this
method to be fired over and over again in a dead loop.
Why is that? What should I do to fix this?
Thanks a lot.
feng