Home | Index | Dotnet4all Snippets | Submit resources
About | Mail us 





Tabcontrol event called at odd time (Wednesday, September 22, 2004)



Found the following interesting discussion in the Newsgroups:

tabcontrol event called at odd time
by:Anonymous

Hello,
I'm curious as to why the following would happen.
I have 4 forms that I'm dealing with. On form4 is a tabcontrol (we'll call it tab1).

When form1 is opened, and OK is pressed, form2 opens, when an item is clicked, form3 opens.
On form 3 is a menu, and when file, open, and form4 is selected, the tab1_SelectedIndexChanged event is triggered...
I have code in here to deal with when users select different tabs...but why would opening the form trigger it?
Obviously I only notice it when I step through the code...is this normal??

Thanks in advance,
amber



 Reply:
by:Jens Blom

 Hi
hmm yes its normal

try this if you dont want it to triger on load
------------------------------------

Dim isLoad As Boolean = False
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
isLoad = True
End Sub
Private Sub TabControl1_SelectedIndexChanged(ByVal _
sender As Object, ByVal e As System.EventArgs) _
Handles TabControl1.SelectedIndexChanged
If isLoad = True Then
MsgBox("ok")
End If
End Sub

-----------------------------------

/Jens



Posted by Xander Zelders



0 Comments:

Post a Comment

<< Home

 
Previous Posts
    - How to catch an event of a running program
    - How to determine the sorted column in a DataGrid.
    - How to Change the foreground / background of a dis...
    - How to: Single file setup
    - BizTalk Server 2002 Bible
    - Programmation XML et SOAP pour serveur BizTalk (av...
    - Microsoft BizTalk Server Resource Kit
    - Microsoft Biztalk Server 2000 Administration (Sams...
    - Microsoft Biztalk Server 2000 Administration (Sams...
    - BizTalk: Implementing Business-to-Business E-comme...



Disclaimer & Terms of Use | DotNet4All.Com concept & © 2004 - 2007 by Zelders² - Holland