Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent control taking focus when accelerator key is used?
I can prevent a Command Button taking the focus when it is clicked, by
setting this property to false at design time. But, this doesn't seem to work when an accelerator key is used - how do I prevent the Command Button taking the focus when it is activated with an accelerator key (eg Alt + 1) ? Using Excel 2003 with Windows XP Professional. Thanks, Michael Jones |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent control taking focus when accelerator key is used?
that appears to be by design. I would suggest that as the first command in
the click event you do ActiveCell.Activate -- Regards, Tom Ogilvy "Michael Jones" wrote in message ... I can prevent a Command Button taking the focus when it is clicked, by setting this property to false at design time. But, this doesn't seem to work when an accelerator key is used - how do I prevent the Command Button taking the focus when it is activated with an accelerator key (eg Alt + 1) ? Using Excel 2003 with Windows XP Professional. Thanks, Michael Jones |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent control taking focus when accelerator key is used?
1 - Apologies if anyone received 2 identical emails from me - my email
reader did not display the 1st email I sent. 2 - Tom - thanks for your response, but as I see it I need something like your solution when I press the (eg) Alt + 1 keys. Is there some sort of global way to trap the Alt + 1 key combination or will I have to do a bit of coding for each control that loses focus because of Alt + 1 ? Thanks, Michael Jones "Tom Ogilvy" wrote in message ... that appears to be by design. I would suggest that as the first command in the click event you do ActiveCell.Activate -- Regards, Tom Ogilvy "Michael Jones" wrote in message ... I can prevent a Command Button taking the focus when it is clicked, by setting this property to false at design time. But, this doesn't seem to work when an accelerator key is used - how do I prevent the Command Button taking the focus when it is activated with an accelerator key (eg Alt + 1) ? Using Excel 2003 with Windows XP Professional. Thanks, Michael Jones |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent control taking focus when accelerator key is used?
I tested it before I posted and it worked for me. Maybe you haven't
accurately articulated your problem. I put a 1 in the property for accelerator for the commandbutton. My suggestion fixed the problem you cited when I did Alt+1. -- Regards, Tom Ogilvy "Michael Jones" wrote in message ... 1 - Apologies if anyone received 2 identical emails from me - my email reader did not display the 1st email I sent. 2 - Tom - thanks for your response, but as I see it I need something like your solution when I press the (eg) Alt + 1 keys. Is there some sort of global way to trap the Alt + 1 key combination or will I have to do a bit of coding for each control that loses focus because of Alt + 1 ? Thanks, Michael Jones "Tom Ogilvy" wrote in message ... that appears to be by design. I would suggest that as the first command in the click event you do ActiveCell.Activate -- Regards, Tom Ogilvy "Michael Jones" wrote in message ... I can prevent a Command Button taking the focus when it is clicked, by setting this property to false at design time. But, this doesn't seem to work when an accelerator key is used - how do I prevent the Command Button taking the focus when it is activated with an accelerator key (eg Alt + 1) ? Using Excel 2003 with Windows XP Professional. Thanks, Michael Jones |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent control taking focus when accelerator key is used?
Tom
Now I understand your solution and it has solved the problem. I hadn't realized that an accelerator key produces a 'click' event. :) It then became an easy matter to code to this event. Many thanks, Michael Jones "Tom Ogilvy" wrote in message ... I tested it before I posted and it worked for me. Maybe you haven't accurately articulated your problem. I put a 1 in the property for accelerator for the commandbutton. My suggestion fixed the problem you cited when I did Alt+1. -- Regards, Tom Ogilvy "Michael Jones" wrote in message ... 1 - Apologies if anyone received 2 identical emails from me - my email reader did not display the 1st email I sent. 2 - Tom - thanks for your response, but as I see it I need something like your solution when I press the (eg) Alt + 1 keys. Is there some sort of global way to trap the Alt + 1 key combination or will I have to do a bit of coding for each control that loses focus because of Alt + 1 ? Thanks, Michael Jones "Tom Ogilvy" wrote in message ... that appears to be by design. I would suggest that as the first command in the click event you do ActiveCell.Activate -- Regards, Tom Ogilvy "Michael Jones" wrote in message ... I can prevent a Command Button taking the focus when it is clicked, by setting this property to false at design time. But, this doesn't seem to work when an accelerator key is used - how do I prevent the Command Button taking the focus when it is activated with an accelerator key (eg Alt + 1) ? Using Excel 2003 with Windows XP Professional. Thanks, Michael Jones |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Taking control of an existing instance of Excel | Excel Programming | |||
Show userform without it taking focus? | Excel Programming | |||
Set Focus Problem for textbox control on multipage control | Excel Programming | |||
Taking focus off a Control Checkbox | Excel Programming | |||
Simulating the Format Painter, Selection.Select, and taking focus | Excel Programming |