HighTechTalks DotNet Forums  

Re: Setting focus for TabControl

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss Re: Setting focus for TabControl in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
 
Posts: n/a

Default Re: Setting focus for TabControl - 11-30-2006 , 08:58 PM






Set the control's SelectedIndex property.


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


"Narasimham" <Narasimham (AT) discussions (DOT) microsoft.com> wrote

Quote:
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 Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.