Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Could not find where the Menu becomes disabled
Message
From
30/05/2009 17:33:32
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01402579
Message ID:
01402804
Views:
49
This message has been marked as a message which has helped to the initial question of the thread.
Depending on where you set the delegate for the SelectedIndexChanged event vs how the TabPages get loaded or instantiated or whatever, my gues is that the SelectedIndexChanged event is firing when you don't expect it to. Have you tried debugging with a breakpoint on that event handler and then checked the Stack Trace?

But probably the easiest workaround is to check that tcOrders.SelectedIndex > -1 first.

~~Bonnie



>Hi everybody,
>
>In my form I have only two places where I try to change Menu.Enabled property.
>
>This is one
>
>private void tcOrders_SelectedIndexChanged(object sender, EventArgs e)
> {
> this.SearchMenuItem.Enabled = (this.tcOrders.SelectedIndex == this.tcOrders.TabPages.IndexOf(tabSearch));
>
>and another one in the form's Constructor where I set it to true. In design time it is set to true as well. Yet the form comes with this menu disabled and I could not find where does it change.
>
>Do you have ideas how can I figure this out?
>
>Thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform