Accelerators in VC++
-
hi all, Actaully my Question seems to be silly but i just wanted to know can i set the same key accelerators to two ID's i.e if i have popup menu lock and unlock a object than if my accelerator is Ctrl+L then on first press of Ctrl+L it should lock object and agian on second time keypress it should unlock it... for lock and unlock the id's are different Thanks Samir
-
hi all, Actaully my Question seems to be silly but i just wanted to know can i set the same key accelerators to two ID's i.e if i have popup menu lock and unlock a object than if my accelerator is Ctrl+L then on first press of Ctrl+L it should lock object and agian on second time keypress it should unlock it... for lock and unlock the id's are different Thanks Samir
-
hi all, Actaully my Question seems to be silly but i just wanted to know can i set the same key accelerators to two ID's i.e if i have popup menu lock and unlock a object than if my accelerator is Ctrl+L then on first press of Ctrl+L it should lock object and agian on second time keypress it should unlock it... for lock and unlock the id's are different Thanks Samir
You could have 2 accelerator tables, one for lock and one for unlock assigned to Ctrl+L and swap between them when needed, or if you create the accelerator table programatically using CreateAcceleratorTable[^] then you could re-create the table with the new key-command assignments as needed, but i doubt you want to go thorough this trouble to implement an ugly solution. You are probably better off assigning a third command to Ctrl+L whose handler will toggle/negate the current state as someone already suggested.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
-
hi all, Actaully my Question seems to be silly but i just wanted to know can i set the same key accelerators to two ID's i.e if i have popup menu lock and unlock a object than if my accelerator is Ctrl+L then on first press of Ctrl+L it should lock object and agian on second time keypress it should unlock it... for lock and unlock the id's are different Thanks Samir