Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with MM TabControl
Message
De
12/11/2007 22:57:44
 
 
À
12/11/2007 14:45:57
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01268559
Message ID:
01268579
Vues:
8
>Is this a Visual Studio problem?
>Is this an MM problem?


Neither ... it's a VB problem. VB requires you to define the control with "WithEvents", like this:
Dim WithEvents TabControl As New TabControl()
Probably if you drop a control on your Form in the IDE, it probably generates the code this way (I don't know, I don't have or use VB), so I'm guessing you probably added this dynamically. Anyway, define it as above with "WithEvents" and it should do the trick.

I just Googled the error message to come up with this answer.

~~Bonnie



>I double clicked the TabControl SelectedIndexChanged event.
>
>The following code was created the in my application:
>
>  Private Sub TabControl_SelectedIndexChanged(ByVal sender As System.Object, _
>    ByVal e As System.EventArgs) Handles TabControl.SelectedIndexChanged
>
>  End Sub
>
>It comes up with an error line under the TabControl after Handles.
>The error for the TabControl is
>"Handles clause requires a WithEvents variable defined in the containing type or one of its base types."
>
>Can I fix this?
>Is this a Visual Studio problem?
>Is this an MM problem?
>Anyone?
>
>Thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform