sounddoc

As the title says, this is what i'd like to do.
When a user selects a certain tabpage, I'd like a msgbox to popup. sounds simple, but i've been racking my brain over how it's done, as it seems that the tabpage methods don't support it I've given this a read through:
But I don't think it helps me very much in the end.
Any suggestions are appreciated - thanks guys!
-Pete


Re: Visual Basic Language msgbox when a tabpage is selected

Frank Carr

Try this:

Private Sub TabControl1_Selecting(ByVal sender As Object, ByVal e As System.Windows.Forms.TabControlCancelEventArgs) Handles TabControl1.Selecting
MsgBox(TabControl1.SelectedTab.Name & " has been selected")
End Sub






Re: Visual Basic Language msgbox when a tabpage is selected

KevinBB

You can try the TabControl.Selected event (new in .NET 2.0) or the TabControl.SelectedIndexChanged event.



Re: Visual Basic Language msgbox when a tabpage is selected

PEng1

You can use the TabPage.Enter Event the only problem I have found is that the message box is display when the form is loaded to, So you need to find a way around that.




Re: Visual Basic Language msgbox when a tabpage is selected

sounddoc

Thanks all!
I used Frank Carr's way, and it works like a charm.
-Pete