how to capture enter key without affrecting copy paste kcust keys

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

If I were to capture enter key on keyup event of an GUI object like comboBox
box, How do I avoid killing ctrol-c, controlv, controlx, shift-insert,
shiftdelete, contrl-insert
 
GS said:
If I were to capture enter key on keyup event of an GUI object like comboBox
box, How do I avoid killing ctrol-c, controlv, controlx, shift-insert,
shiftdelete, contrl-insert

Hi,

Unfortunately, I don't know what's the problem: When I capture the
[Enter]-key of a textbox, the ctrl and shift still works... I haven't
tested it with a ComboBox but I think it should work there, too.
Could you specify your problem a little more, please?

Thanks,
Norman
 
it is just that in my combobox, control-c , control-v, control-x are
ignored, the Shift-delete... etc are ignored

My code for capturing the return key in a combobox is

Private Sub addressBar_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles addressBar.KeyUp
If (e.KeyCode = Keys.Return) Then
.... my code for processing return key
end if
end sub

I just did no deal with other keys and I guess that could be my problem

I could still do copy, cut, paste via mouse but not with keyboard
Norman Chong said:
If I were to capture enter key on keyup event of an GUI object like comboBox
box, How do I avoid killing ctrol-c, controlv, controlx, shift-insert,
shiftdelete, contrl-insert

Hi,

Unfortunately, I don't know what's the problem: When I capture the
[Enter]-key of a textbox, the ctrl and shift still works... I haven't
tested it with a ComboBox but I think it should work there, too.
Could you specify your problem a little more, please?

Thanks,
Norman
 
GS said:
it is just that in my combobox, control-c , control-v, control-x are
ignored, the Shift-delete... etc are ignored

Strange problem... When I use the KeyUp-Event of a ComboBox and react
to [Return], other keys aren't affected - Everything works fine?!?

I'm sure that you don't have to react to other keys within the event -
When you just do something when pressing [Return], the functionality
ofother keys won't be deleted, so this is not the problem.

Do you catch [Ctrl]-X or [Shift]-X somewhere else in your code?
Can you write text into the ComboBox or are the other keys ignored,
too?
Is it possible that the code within your KeyUp-Event has something to
do with this problem?
Does this problem appear with other controls (Or in another
application)?
Does the problem appear when using simple test-code within the
KeyUp-Event (e.g. just showing a MessageBox)?
Does the problem appear when working on a different system?

Stupid questions, I know. But I don't have any idea why this happens -
So it might be a good idea to get a little closer to the source of the
problem \ to the root of all evil ;-)
 
Back
Top