Trap CTRL+TAB when tab dialog control does not have focus

Trap CTRL+TAB when tab dialog control does not have focus

Post by Atrej » Fri, 06 Aug 2004 04:27:20


I've noticed that my SSTab control will switch tabs when I hit
CTRL+TAB (which is pretty much a standard for 'next tab'). However, it
only traps it if the tab itself has focus.

Anyway to trap this no matter what control on the form has focus?

I thought I read about this in the past, but I don't remember how.

Thanks.


---Atreju---
 
 
 

Trap CTRL+TAB when tab dialog control does not have focus

Post by erewho » Fri, 06 Aug 2004 15:25:24

On Wed, 04 Aug 2004 19:27:20 GMT, Atreju < XXXX@XXXXX.COM >



Set the Tabstop property of all Controls to False
Then get the Tab key in the Form's Key events with KeyPreview on

 
 
 

Trap CTRL+TAB when tab dialog control does not have focus

Post by Atrej » Fri, 06 Aug 2004 20:58:47

On Thu, 5 Aug 2004 06:25:24 +0000 (UTC), XXXX@XXXXX.COM (J




But I DO want the TAB key to work on the controls so that the user can
tab between controls. Do I have to code it all?


---Atreju---
 
 
 

Trap CTRL+TAB when tab dialog control does not have focus

Post by erewho » Sat, 07 Aug 2004 02:11:04

On Thu, 05 Aug 2004 11:58:47 GMT, Atreju < XXXX@XXXXX.COM >


<snip>


You are generally better off controlling the lot

Personally I think the ssTab Control stinks

- but I would say that ...
 
 
 

Trap CTRL+TAB when tab dialog control does not have focus

Post by Atrej » Sat, 07 Aug 2004 06:56:18

On Thu, 5 Aug 2004 17:11:04 +0000 (UTC), XXXX@XXXXX.COM (J



Really? I actually like it a lot.

What do you use when you want tabbed dialogue?


---Atreju---
 
 
 

Trap CTRL+TAB when tab dialog control does not have focus

Post by fajp » Sat, 07 Aug 2004 13:56:10

On Thu, 05 Aug 2004 21:56:18 GMT, Atreju < XXXX@XXXXX.COM >



IIRC, Jerry has made his own once. It's not that hard you know, a
bunch of frames in a picturebox with a label or option button
row(style=graphical) at the top and you just swap frame's visibility
as needed. As a one-off it's quite easy to do(done that before), a
usercontrol would be a bit more work, but probably be worth the time
if you use them regularly.

As for your sstab, you could subclass the form. If you get a uMsg
which is KEY_UP or KEY_DOWN with the control flag set and the
Activecontrol is not the sstab, set the next tab on the sstab
manually, then sink the message.

--

Regards, Frank
 
 
 

Trap CTRL+TAB when tab dialog control does not have focus

Post by erewho » Sat, 07 Aug 2004 16:49:22

On Fri, 06 Aug 2004 14:56:10 +1000, XXXX@XXXXX.COM (Frank





<snip>

Actually the one I made is just a UserControl without any embedded
controls - I just paint the Tabs on the face of the UserControl

Of course, like the MS Tabstrip one then needs Frames (or user
controls) for the 'pages' - but I infinitely prefer that approach,
mainly because I like to load and position Frames, Controls etc at run
time