Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TabControl and TapPage
Message
 
À
22/09/2004 17:51:56
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00945221
Message ID:
00945591
Vues:
14
Vincent,

>How can i access the properties of the tabControl and tabPage so that i can get to the tabindexchange event.

If I remember correctly you're using VB .NET (how could you NOT with YOUR initials <g>). Although VB .NET's WithEvents can be "handier" than C#'s event handler creation, this is one of those cases where it's not. Normally you would select the TabControl from the top-left combo box in the VS .NET IDE and select the event to handle in the top-right combo box. However, since the tab control is inherited from the base form it doesn't show up in this list. By the way, this is fixed in Whidbey for VB .NET...you get the lightning bolt in the Properties Window just as in C#.

ANYWAY, you have to manually create the event handler in VB .NET. For example, to create an event handler for an inherited TabControl, you can add a handler method to your form like this:
Private Sub TabControl_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub
Then in your form's constructor, add code that registers the event handler with the associated event. For example:
AddHandler TabControl.SelectedIndexChanged, AddressOf Me.TabControl_SelectedIndexChanged
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform