|
|
Hi, I have a ATL COM add-in for outlook which has a toolbar and a button. I added a _CommandBarComboBox to the commandbar and would like to now trap the "enter" key when user types in something and hits the "Enter" key. I find that there is only 1 event that is generated - Change. However, when I trap this event, my handler is never invoked
Any clues???
Thanks
|
|
Assuming your event handler is correctly set up and instantiated, are you tabbing out of the combo control? That should fire the Change event.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
"Exchnerd" <sanjuraja[ at ]gmail.com> wrote in message news:4a6092e7-ae6c-446e-89fa-c0350c0f6416[ at ]w1g2000prk.googlegroups.com...
[Quoted Text] > Hi, I have a ATL COM add-in for outlook which has a toolbar and a > button. I added a _CommandBarComboBox to the commandbar and would like > to now trap the "enter" key when user types in something and hits the > "Enter" key. I find that there is only 1 event that is generated - > Change. However, when I trap this event, my handler is never invoked > > Any clues??? > > Thanks
|
|
What does "tabbing out" mean? If you are referring to the scope of the control, it is a member variable and not a stack var. I have registered for the button OnClick and other events and have registered in a similar fashion.
On Nov 12, 9:38 am, "Ken Slovak - [MVP - Outlook]" <kenslo...[ at ]mvps.org> wrote:
[Quoted Text] > Assuming your event handler is correctly set up and instantiated, are you > tabbing out of the combo control? That should fire the Change event. > > -- > Ken Slovak > [MVP - Outlook] http://www.slovaktech.com> Author: Professional Programming Outlook 2007. > Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm> > "Exchnerd" <sanjur...[ at ]gmail.com> wrote in message > > news:4a6092e7-ae6c-446e-89fa-c0350c0f6416[ at ]w1g2000prk.googlegroups.com... > > > Hi, I have a ATL COM add-in for outlook which has a toolbar and a > > button. I added a _CommandBarComboBox to the commandbar and would like > > to now trap the "enter" key when user types in something and hits the > > "Enter" key. I find that there is only 1 event that is generated - > > Change. However, when I trap this event, my handler is never invoked > > > Any clues??? > > > Thanks
|
|
Tabbing out means to use the Tab key to move from the control. That's what fires the Change event you're looking for.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
"Exchnerd" <sanjuraja[ at ]gmail.com> wrote in message news:efa1b7fc-f8a1-48eb-8da2-13771a19f721[ at ]v22g2000pro.googlegroups.com... What does "tabbing out" mean? If you are referring to the scope of the control, it is a member variable and not a stack var. I have registered for the button OnClick and other events and have registered in a similar fashion.
|
|
On Nov 12, 1:48 pm, "Ken Slovak - [MVP - Outlook]" <kenslo...[ at ]mvps.org> wrote:
[Quoted Text] > Tabbing out means to use the Tab key to move from the control. That's what > fires the Change event you're looking for. > > -- > Ken Slovak > [MVP - Outlook] http://www.slovaktech.com> Author: Professional Programming Outlook 2007. > Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm> > "Exchnerd" <sanjur...[ at ]gmail.com> wrote in message > > news:efa1b7fc-f8a1-48eb-8da2-13771a19f721[ at ]v22g2000pro.googlegroups.com... > What does "tabbing out" mean? If you are referring to the scope of the > control, it is a member variable and not a stack var. I have > registered for the button OnClick and other events and have registered > in a similar fashion. I've tried this but no event is fired!! Just cannot understand what I am missing. Does it not fire if you hit the "enter" key?
|
|
I believe it should but I know for a fact it does when you use Tab.
If it's not firing then the event handler isn't being added correctly.
I rarely use those CommandBarComboBox controls since they are so limited in usability.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
"Exchnerd" <sanjuraja[ at ]gmail.com> wrote in message news:fddba2dc-a1a0-416d-86ab-7528c15b0f3f[ at ]c22g2000prc.googlegroups.com... <snip> I've tried this but no event is fired!! Just cannot understand what I am missing. Does it not fire if you hit the "enter" key?
|
|
On Nov 12, 4:16 pm, "Ken Slovak - [MVP - Outlook]" <kenslo...[ at ]mvps.org> wrote:
[Quoted Text] > I believe it should but I know for a fact it does when you use Tab. > > If it's not firing then the event handler isn't being added correctly. > > I rarely use those CommandBarComboBox controls since they are so limited in > usability. > > -- > Ken Slovak > [MVP - Outlook] http://www.slovaktech.com> Author: Professional Programming Outlook 2007. > Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm> > "Exchnerd" <sanjur...[ at ]gmail.com> wrote in message > > news:fddba2dc-a1a0-416d-86ab-7528c15b0f3f[ at ]c22g2000prc.googlegroups.com... > <snip> > I've tried this but no event is fired!! Just cannot understand what I > am missing. Does it not fire if you hit the "enter" key? It works now!!
I was releasing the pointer immediately after registering :-((
Now, how do I differentiate between a "Enter" key or lost focus, change focus? I need to do something similar to google toolbar - when the user hits the "enter" key, I need to process the request. All other cases must be ignored
|
|
What you have with that control is the Change event and that's it. It's very limited and that's why I almost never use that control.
Normally I'd use a button control and use that click to open a form that has a drop-down control and possibly others. That lets me get lost focus and various other events not exposed for a CommandBarComboBox control.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
"Exchnerd" <sanjuraja[ at ]gmail.com> wrote in message news:1e6d560e-fa74-4ee7-bb71-cf99d0be6f5f[ at ]35g2000pry.googlegroups.com... <snip> It works now!!
I was releasing the pointer immediately after registering :-((
Now, how do I differentiate between a "Enter" key or lost focus, change focus? I need to do something similar to google toolbar - when the user hits the "enter" key, I need to process the request. All other cases must be ignored
|
|
On Nov 13, 9:38 am, "Ken Slovak - [MVP - Outlook]" <kenslo...[ at ]mvps.org> wrote:
[Quoted Text] > What you have with that control is the Change event and that's it. It's very > limited and that's why I almost never use that control. > > Normally I'd use a button control and use that click to open a form that has > a drop-down control and possibly others. That lets me get lost focus and > various other events not exposed for a CommandBarComboBox control. > > -- > Ken Slovak > [MVP - Outlook] http://www.slovaktech.com> Author: Professional Programming Outlook 2007. > Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm> > "Exchnerd" <sanjur...[ at ]gmail.com> wrote in message > > news:1e6d560e-fa74-4ee7-bb71-cf99d0be6f5f[ at ]35g2000pry.googlegroups.com... > <snip> > It works now!! > > I was releasing the pointer immediately after registering :-(( > > Now, how do I differentiate between a "Enter" key or lost focus, > change focus? I need to do something similar to google toolbar - when > the user hits the "enter" key, I need to process the request. All > other cases must be ignored Are these any different from the controls that IE has? For e.g. Google toolbar
|
|
On Nov 13, 10:45 am, Exchnerd <sanjur...[ at ]gmail.com> wrote:
[Quoted Text] > On Nov 13, 9:38 am, "Ken Slovak - [MVP - Outlook]" > > > > <kenslo...[ at ]mvps.org> wrote: > > What you have with that control is the Change event and that's it. It's very > > limited and that's why I almost never use that control. > > > Normally I'd use a button control and use that click to open a form that has > > a drop-down control and possibly others. That lets me get lost focus and > > various other events not exposed for a CommandBarComboBox control. > > > -- > > Ken Slovak > > [MVP - Outlook] http://www.slovaktech.com> > Author: Professional Programming Outlook 2007. > > Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm> > > "Exchnerd" <sanjur...[ at ]gmail.com> wrote in message > > >news:1e6d560e-fa74-4ee7-bb71-cf99d0be6f5f[ at ]35g2000pry.googlegroups.com... > > <snip> > > It works now!! > > > I was releasing the pointer immediately after registering :-(( > > > Now, how do I differentiate between a "Enter" key or lost focus, > > change focus? I need to do something similar to google toolbar - when > > the user hits the "enter" key, I need to process the request. All > > other cases must be ignored > > Are these any different from the controls that IE has? For e.g. Google > tool You could consider the address book itself in outlook. There is a combo box next to the address book button and it works as expected - how is this achieved?
|
|
CommandBar* controls are different than the normal forms combobox controls or other form controls or controls you see in IE. That's why I use a forms type combo instead of the CommandBarCombo version, it does what I want.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
"Exchnerd" <sanjuraja[ at ]gmail.com> wrote in message news:36fbdf74-5253-44dd-9e49-e060c2e342cd[ at ]u29g2000pro.googlegroups.com... On Nov 13, 10:45 am, Exchnerd <sanjur...[ at ]gmail.com> wrote: <anip>
[Quoted Text] > Are these any different from the controls that IE has? For e.g. Google > tool
You could consider the address book itself in outlook. There is a combo box next to the address book button and it works as expected - how is this achieved?
|
|
On Nov 13, 3:46 pm, "Ken Slovak - [MVP - Outlook]" <kenslo...[ at ]mvps.org> wrote:
[Quoted Text] > CommandBar* controls are different than the normal forms combobox controls > or other form controls or controls you see in IE. That's why I use a forms > type combo instead of the CommandBarCombo version, it does what I want. > > -- > Ken Slovak > [MVP - Outlook] http://www.slovaktech.com> Author: Professional Programming Outlook 2007. > Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm> > "Exchnerd" <sanjur...[ at ]gmail.com> wrote in message > > news:36fbdf74-5253-44dd-9e49-e060c2e342cd[ at ]u29g2000pro.googlegroups.com... > On Nov 13, 10:45 am, Exchnerd <sanjur...[ at ]gmail.com> wrote: > <anip>> Are these any different from the controls that IE has? For e.g. Google > > tool > > You could consider the address book itself in outlook. There is a > combo box next to the address book button and it works as expected - > how is this achieved? I am talking of the controls on the command bar of outlook, not the controls on the form that opens up when you click the address book button. The combo box on the toolbar beside the address book button that allows us to enter a name to search for. I verified with Spy++ and it is the same class that I am using.!
|
|
Many of the controls used for CommandBar controls behave differently when used internally by MS than they do for you and many aren't available to you. There's nothing you or I can do to change that. What you see is what you get with that control, and if you aren't happy with how it works for you, use something else.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm
"Exchnerd" <sanjuraja[ at ]gmail.com> wrote in message news:00325e3a-449d-4639-96f4-5c76183ce99c[ at ]w39g2000prb.googlegroups.com... <snip> I am talking of the controls on the command bar of outlook, not the controls on the form that opens up when you click the address book button. The combo box on the toolbar beside the address book button that allows us to enter a name to search for. I verified with Spy++ and it is the same class that I am using.!
|
|
|