PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Re: Setting focus for TabControl

Reply

Re: Setting focus for TabControl

 
Thread Tools Rate Thread
Old 01-12-2006, 01:58 AM   #1
Guest
 
Posts: n/a
Default Re: Setting focus for TabControl


Set the control's SelectedIndex property.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


"Narasimham" <Narasimham@discussions.microsoft.com> wrote in message
news:8BE29A32-64A5-4393-A556-E07915CB1A53@microsoft.com...
> Hi,
>
> I have a TabControl in my Windows Mobile 5.0 application running .NET CF
> 2.0. I have a requirement that needs to be able to switch between tab
> pages
> using hot keys. Does any one have any idea how this can be achieved.
>
> I have written a simple function to test the functionality of actually
> switching the tabs programatically by calling a function. But it does not
> seem to work.
>
> Sample piece of code is below:
>
> if (String.Compare(e.KeyChar.ToString(), Keys.F.ToString(),
> true) == 0)
> {
> //findTabPage.Show();
> //findTabPage.Focus();
> //findTabPage.Update();
> //((TabFindItemPanel)findTabPage.Controls[0]).Show();
>
> //tabControl.Controls[tabControl.Controls.IndexOf(findTabPage)].Show();
>
> tabControl.TabPages[tabControl.Controls.IndexOf(findTabPage)].Focus();
>
> tabControl.TabPages[tabControl.Controls.IndexOf(findTabPage)].Show();
> }
>
> findTabPage is a TabPage inside tabControl.
>
> The commented lines are things i tried and not working. So I tried various
> different routes.
>
> Thanks,
> Narasimham



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off