How to cancel Ctr+Tab on TabControl?

T

TK

I'm building an Wizard style Win Form application. And am using TabControl
to design and run the subsequent pages (actually 6 pages to finish the
Wizard).

Because it's an Wizard application, it shouldn't allow user to go next page
while required text boxes are blank. To accomplish this, I timidly examine
such required fields and then control the NextButton.Enabled property in
each pages. I know it may not be a smart way but is the only way known by me
now. My wizard works fine excepting one point.

TabControl itself has built-in Short Cut Key feature which changes the
current TabPage by CTR+Tab key. I want to cancel this short cut event but
don't know how.

How can I cancel such key event?
Please help me.

TK
 
M

Mick Doherty

A vb.net solution:
\\\
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, _
ByVal keyData As Keys) As Boolean
If TypeOf ActiveControl Is TabControl Then
If keyData = (Keys.Control Or Keys.Tab) Then
Return True
End If
End If
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top