>Hi Tim,
>
>I think the error of (somecondition = false) rather than (somecondition == false) was made when I typed it into my message. The compiler and I have this conversation quite regularly, although it is becoming less frequent. I will give the SelectedIndex option. I'm still curious, though, about why the focus() method would not accomplish the same thing? Does that only work for objects on the same page?
>
I know what you mean about the compiler conversation on that. I have the same one but at least I recognize the message and can fix it right off. :-)
I am not sure about the focus thing other than the page is a object within the tab control so at a minimum you would have to navigate via the tab control first. a aBy calling SelectedIndex of the tab control I just avoid it.
>Thanks.
>>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
Timothy Bryan