There are situations where I want to prevent the user from switching between sheet windows via Ctrl-Tab.
I have tried the following in the datawindow pbm_dwnkey event (without success):
blob{64} lblb_Msg
PeekMessage(lblb_Msg, 0, 256, 264, 1 ) //WM_KEYFIRST = 0x0100 256 WM_KEYLAST = 0x0108 264 PM_REMOVE = 1
message.processed = TRUE
message.returnvalue = 1
Return 1
Is there another way to do this?
i first considered this solution, but could not assign the ctrl-tab shortcut in the menu. How did you do that.
Yes, the TAB assignment is not there in the Menu painter - so you need to edit the menu source directly and provide the shortcut property's numeric value directly in the source code. I can't remember the exact number offhand for this combination but, I do have the following code example ...
int sh
sh = m.item.ShortCut
if sh > 0 then
ls_sh = "~t"
if sh >= 1024 then
ls_sh += "Shift+"
sh -= 1024
end if
if sh >= 512 then
ls_sh += "Alt+"
sh -= 512
end if
if sh >= 256 then
ls_sh += "Ctrl+"
sh -= 256
end if
So since the numeric value for CTRL is 256, you just need to add the numeric value for a TAB character (ASCII keyboard wise). If I recall correctly though, a TAB is a keyboard numeric #9. So a CTRL+TAB should be 256 + 9 = 265 for the menu item shortcut property value. HTH
Regards ... Chris