.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

textbox Enter KeyEvent Argument not handled

2 REPLIES 2
Reply
Message 1 of 3
SRSDS
308 Views, 2 Replies

textbox Enter KeyEvent Argument not handled

I have a pallete with a textbox. The keydown event is triggered on every keydown event apart from  Enter.

    Private Sub txtBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtBox.KeyDown
        If e.KeyCode = Forms.Keys.Enter Then MsgBox("Enter Pressed")
    End Sub

 Has me baffled.

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: SRSDS

Hi,

 

the key <ENTER> has a special function as it is used to change the focus to the next control in tab-order. So the key is handled from another part and the event is then not fired to your eventhandler as "it is handled already".

 

I have searched a little and I think >>>that link (scroll down to the end)<<< comes close to what you are looking for.

 

The other opportunity would be to catch the LostFocus event it the fits to your workflow.

 

- alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3
SRSDS
in reply to: Alfred.NESWADBA

Hi,

I tried the code from the page but it was causing some sort of problem in loading the pallete container.

 

I've found out that the KeyUp event can be used. The KeyDown and KeyPressed were two that I was trying previously.

 

But now that I think about it, the user has to make sure that they press enter so it's probably not what I want.

I think I should stick to doing it live with the TextChanged event.

 

Thanks again

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost