K
Kbalz
I'm developing a Wizard type program, and I'm flipping between steps
by using a TabControl.. buttons on each tabPage move to the next or
previous tabPage.
When I press CTRL+Tab however, the tabControl begins to cycle through
the tabPages, just as it does in Visual Studio, IE7 etc.. any tabbed
program.
I need this blocked.
I am already catching key input from the user.. when the first tabPage
of my Wizard is active, and the user presses control+a, a "secret
admin" tabPage is shown.. My boss wanted this so that he could
dynamically set some variables for the wizard. This is working very
well. So I thought I only needed to extend this to capture control
+tab key strokes, and do nothing when they are pressed..
Here is my KeyDown event for the Form:
private void adminTab_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers.Equals(Keys.Control) &
e.KeyCode.Equals(Keys.A) & (tcBody.SelectedTab.Equals(tabWelcomeKey)))
initAdminTab();
if (e.Modifiers.Equals(Keys.Control) &
e.KeyCode.Equals(Keys.Tab))
{ /* do nothing, however - the tabPages still move */ }
}
Is there any way I can block this control+tab from fliping my
tabPages? Basically using this method, it is possible to access my
adminTab from any tab, which I don't want.
I guess the alternative is to place a "onTabPageChanged" event to my
tabcontrol, and do some flag checking there to determine if I display
my admin page or not. But that only protect my adminTab, it doesn't
really prevent the user from screwing up the entire wizard !!
Any help or suggestions ? Thanks,
by using a TabControl.. buttons on each tabPage move to the next or
previous tabPage.
When I press CTRL+Tab however, the tabControl begins to cycle through
the tabPages, just as it does in Visual Studio, IE7 etc.. any tabbed
program.
I need this blocked.
I am already catching key input from the user.. when the first tabPage
of my Wizard is active, and the user presses control+a, a "secret
admin" tabPage is shown.. My boss wanted this so that he could
dynamically set some variables for the wizard. This is working very
well. So I thought I only needed to extend this to capture control
+tab key strokes, and do nothing when they are pressed..
Here is my KeyDown event for the Form:
private void adminTab_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers.Equals(Keys.Control) &
e.KeyCode.Equals(Keys.A) & (tcBody.SelectedTab.Equals(tabWelcomeKey)))
initAdminTab();
if (e.Modifiers.Equals(Keys.Control) &
e.KeyCode.Equals(Keys.Tab))
{ /* do nothing, however - the tabPages still move */ }
}
Is there any way I can block this control+tab from fliping my
tabPages? Basically using this method, it is possible to access my
adminTab from any tab, which I don't want.
I guess the alternative is to place a "onTabPageChanged" event to my
tabcontrol, and do some flag checking there to determine if I display
my admin page or not. But that only protect my adminTab, it doesn't
really prevent the user from screwing up the entire wizard !!
Any help or suggestions ? Thanks,