Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with MM TabControl
Message
From
12/11/2007 22:57:44
 
 
To
12/11/2007 14:45:57
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01268559
Message ID:
01268579
Views:
7
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform