Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting focus to another tab page
Message
From
01/12/2008 18:44:23
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01362031
Message ID:
01364972
Views:
13
>>Hi Linda,
>>
>>>I have a form with multiple tab pages. On one of the pages, I want to test some conditions and, if those conditions are not met, set the focus to another tab. On the Enter method of the page, I used a statement like:
>>>
>>>
>>>if (somecondition = false)
>>>{
>>>    mmAppDeskTop.MessageBox.Show("You must take care of business.");
>>>    pgOtherPage.Focus();
>>>    return;
>>>}
>>>
>>>
>>>The code executes without an error but it doesn't change the focus. Is there some equivalent to "nodefault()" that I need to use?
>>>
>>>Thanks.
>>
>>I first assume the compiler would have caught the error of (somecondition = false) rather than (somecondition == false)
>>As far as changing to another page, try this.
>>
>>MyTabControl.SelectedIndex = 2;
>>
>>Tim
>

Great Linda. You could also do this:
this.MyTabControl.SelectedTab = this.pgOtherPage;
>Thanks, Tim. I did finally try this and it took care of the problem.
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform