473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Form KeyPreview

I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.

Can some one tell me why & how can it be done?

best regards,
habix
Nov 20 '05 #1
13 3798
* "HABJAN ®iga" <habix[AT]intelcom[DOT]si> scripsit:
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
yust a thought
you might want to get other combinations then the alt+..
Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


are you intercepting the keys on the cbo keypress event?

eric
Nov 20 '05 #3
Client wants to use Alt+hotkey...

I'am acctuayl not using comboboxes, but autocompletecombobox (inherited from
combo + autocomlete logic).

I intercept keydown in ACCombobox, handle it, and call mybase.keydown.....
But the form doesn't raise keydown (keypreview)....

thanks,
habix
"EricJ" <ericRéMo**@ThiSomnipack.be> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


yust a thought
you might want to get other combinations then the alt+..
Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


are you intercepting the keys on the cbo keypress event?

eric


Nov 20 '05 #4
Good thinking....

I'll have this option in mind if i don't find any other solutions (why
should combobox be diferent than other controls)...

Thanks,
habix
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "HABJAN ®iga" <habix[AT]intelcom[DOT]si> scripsit:
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
Q.) Is the KeyPreview set to true or false.?
Q.) If it is set to True, then the control with focus will not receive the
key events.
Q.) If it is set to false, are other controls receiving the events and only
the ComboBox not receiving ?

OHM
HABJAN ®iga wrote:
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.

Can some one tell me why & how can it be done?

best regards,
habix


Best Regards - OHMBest Regards - OHM On**********@BTInternet.Com
Nov 20 '05 #6
There is a silly walkaround :o):

Let's assume we wan't to catch alt+o, and we have focus on combobox (that
doesn't fire form's keypreview...)

I created a temp button
(
text = "&oTemp"
size = "0;0"
)

When i press alt+o, the form brings the focus to temporary button
(automatic), and then it raises keydown event.

The trouble is... i lost focus every time i press alt+o (so i have to handle
that too)

re, habix
"HABJAN ®iga" <habix[AT]intelcom[DOT]si> wrote in message
news:bq********@enews4.newsguy.com...
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.

Can some one tell me why & how can it be done?

best regards,
habix

Nov 20 '05 #7
I tryed creating some hidden menus, but the shortcut property doesn't
support Alt+Letter (only alt+(0-9) & alt+(f1-f12)), so this walkaround isn't
good.

Any way to intercept key down before all controls?

best re,
habix

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "HABJAN ®iga" <habix[AT]intelcom[DOT]si> scripsit:
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #8
* "HABJAN Ziga" <habix[AT]intelcom[DOT]si> scripsit:
I'll have this option in mind if i don't find any other solutions (why
should combobox be diferent than other controls)...


Maybe it's an other combobox problem (I heard about similar problems
with this control).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
yust thinking here
the key would be cought in the lowest level (in this case your combo)
im thinking in the lines of catching errors

try
try
error
catch
'youll get the error here
end try
catch
'nothing here
end try

"HABJAN ®iga" <habix[AT]intelcom[DOT]si> wrote in message
news:bq********@enews4.newsguy.com...
Client wants to use Alt+hotkey...

I'am acctuayl not using comboboxes, but autocompletecombobox (inherited from combo + autocomlete logic).

I intercept keydown in ACCombobox, handle it, and call mybase.keydown.....
But the form doesn't raise keydown (keypreview)....

thanks,
habix
"EricJ" <ericRéMo**@ThiSomnipack.be> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


yust a thought
you might want to get other combinations then the alt+..
Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


are you intercepting the keys on the cbo keypress event?

eric


Nov 20 '05 #10
have you tried using (in the text of the menu item) nam&e --> alt+e would
be the shortcut (the menu item would have to be top level i think)
"HABJAN Ziga" <habix[AT]intelcom[DOT]si> wrote in message
news:bq********@enews4.newsguy.com...
I tryed creating some hidden menus, but the shortcut property doesn't
support Alt+Letter (only alt+(0-9) & alt+(f1-f12)), so this walkaround isn't good.

Any way to intercept key down before all controls?

best re,
habix

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "HABJAN ®iga" <habix[AT]intelcom[DOT]si> scripsit:
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.


Why not define hidden menu items with the "hotkeys" ('Shortcut'
property)?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #11

exactly :) the key preview is set to true. but when i have focus on combobox
the keydown event on form isn't raised.

re,
habix

"One Handed Man" <Bo****@Duck.net> wrote in message
news:bq**********@hercules.btinternet.com...
Q.) Is the KeyPreview set to true or false.?
Q.) If it is set to True, then the control with focus will not receive the key events.
Q.) If it is set to false, are other controls receiving the events and only the ComboBox not receiving ?

OHM
HABJAN ®iga wrote:
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.

Can some one tell me why & how can it be done?

best regards,
habix


Best Regards - OHMBest Regards - OHM On**********@BTInternet.Com

Nov 20 '05 #12
I think that microsoft has to make some bugfixes in form's controls
(framework).

I had trouble with comboboxes (keypreview), date-time pickers (frezzes main
thread - to solve this one i needed to use vb6's dt-pickers - but they don't
have itemchecked event...), listview's (triple select index changed events
if changing property selectedindex within event - but only in runtime,
everything works fine in debug mode)....

I had troublues with combos even in html page =), they are allways topmost
component
- no fuckin <div
style="position:absolute;x:0,y:0:height:100%;width =100%;bgcolor=black" />
can't be over it

I am seriously thinking about buying some stable components or start
learning delphi or something....

re,
habix


"HABJAN ®iga" <habix[AT]intelcom[DOT]si> wrote in message
news:bq********@enews4.newsguy.com...
I'am using form's keypreview property & keydown (on form) to look for
hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.

Can some one tell me why & how can it be done?

best regards,
habix

Nov 20 '05 #13
You are absolutely correct. This appears to be a bug, you should report it
to Microsoft.

Regards - OHM

HABJAN ®iga wrote:
exactly :) the key preview is set to true. but when i have focus on
combobox the keydown event on form isn't raised.

re,
habix

"One Handed Man" <Bo****@Duck.net> wrote in message
news:bq**********@hercules.btinternet.com...
Q.) Is the KeyPreview set to true or false.?
Q.) If it is set to True, then the control with focus will not
receive the key events.
Q.) If it is set to false, are other controls receiving the events
and only the ComboBox not receiving ?

OHM
HABJAN ®iga wrote:
I'am using form's keypreview property & keydown (on form) to look
for hotkeys (alt+?)

Everything works fine, except when i have focus on combobox.
Then the event on form isn't raised.

Can some one tell me why & how can it be done?

best regards,
habix


Best Regards - OHMBest Regards - OHM On**********@BTInternet.Com


Best Regards - OHMBest Regards - OHM On**********@BTInternet.Com
Nov 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carl Tribble | last post by:
I am using KeyPreview on the form to trap Function-keys. My form includes a datagrid. I am using the Form.KeyDown event to trap the keys and all works fine unless the datagrid is showing one or...
1
by: Ori | last post by:
Hi Guys, Here is my problem, but maybe someone can help me with this. Background: 1. Using C#. 2. I'm having a form which the KeyPreview is on (and must stay like this) and I'm...
1
by: ray well | last post by:
hi, i need to preview the keys in my app in order to process F1-F10. i set keypreview of my form to true, and it does capture the keystrokes from all over the forms controls which i then...
1
by: Rene | last post by:
Hi, I am running is some problems with the KeyPreview and KeyPress events. The KeyPress event is only triggered when there this an focusable control on the form. When all controls are disabled...
13
by: Himselff | last post by:
Hi guys, Im new to dot net and wondering how i could remake the same way i was in vb6, capture all keypress whitin a form, per exemple i was on the form looking for some keypress privete...
3
by: Nikolay Evseev | last post by:
Hi, I am trying to trace down the Enter key in my Form.KeyPress event handler. The KeyPreview property is set to false, so I'd assume that all key presses should go through my form's KeyPress...
9
by: Rob | last post by:
When a custom control is used within a form, that control does not get events directly. I've run into this a couple times with both mouse and keyboard events. Ex: A custom control inherits from...
4
by: polocar | last post by:
Hi, I would like to find a way in C# so that, when the user presses the "Esc" key, the form closes; the problem is that I have a lot of controls in the form. At the beginning I have tried with...
1
by: Ben | last post by:
Hi I would like to complete a task whenever F4 is pressed by the user anywhere on a form. The problem is the Key Down event does not fire for the form if the user is, for example within a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.