|
-
Dec 20th, 2003, 06:50 PM
#1
Thread Starter
PowerPoster
Tab control click event
This should be a simple enough thing to do:
VB Code:
Private Sub tabClock_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles tabClock.Click
tmrOne.Enabled = True ' start main clock timer
' more code to go here
End Sub ' tabClock_Click
All I want to do is to start the timer when a particular tab is clicked, but the timer never starts. I put a breakpoint in the first line of code and the break never happens, which suggests that the click event is being completely ignored.
I've hunted high and low in MSDN Library for what's going on, to no avail. Have any of you guys got any ideas?
-
Dec 20th, 2003, 10:50 PM
#2
Sleep mode
One way
VB Code:
Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
If Me.TabControl1.SelectedIndex = 0 Then
MsgBox("you clicked TabPage1")
End If
End Sub
-
Dec 21st, 2003, 04:38 PM
#3
Thread Starter
PowerPoster
Thanks Pirate,
That does work, though it also has the annoying side effect of executing that code when the app is started. I expect I can work round that if I have to.
I'm still curious as to why the Click event doesn't work, though. Is it a bug or do I need to do something else to make it work?
-
Dec 21st, 2003, 10:42 PM
#4
Sleep mode
This will work , I mean it won't show anything unless the tabpage is completely shown .
VB Code:
Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
Dim indx As Integer = Me.TabControl1.SelectedIndex
If indx = 0 AndAlso Me.TabControl1.TabPages(indx).Focus = True Then
MsgBox("blah")
End If
End Sub
-
Dec 22nd, 2003, 02:06 PM
#5
Thread Starter
PowerPoster
Excellent, that'll do nicely 
Thanks again Pirate.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|