Results 1 to 14 of 14

Thread: Code allowing the key entered to validate

  1. #1

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Code allowing the key entered to validate

    I want a Code allowing the key entered to validate... Net(DotNet) TO CANCEL An OPERATION BY SUPPORT OF KEY ECHAP...

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Code allowing the key entered to validate

    You lost me.
    Could you please rephrase the question?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    Fanatic Member
    Join Date
    Feb 2007
    Location
    Eindhoven
    Posts
    828

    Re: Code allowing the key entered to validate

    use textBox_Kepress() event

    vb Code:
    1. private sub textBox1_KeyPress(sender as objectm, e as KeyEventArgs)
    2.    if e.KeyCode = keys.Enter then
    3.       messageBox.show(textBox1.text)
    4.    end if
    5. end sub
    Last edited by talkro; Jun 8th, 2007 at 08:45 AM.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Re: Code allowing the key entered to validate

    Thank you initially for your answer then me I have a textbox then I want to click on the entered key of keyboard I want post a message which contain the value which J have déja typed on this textbox

  5. #5
    Fanatic Member
    Join Date
    Feb 2007
    Location
    Eindhoven
    Posts
    828

    Re: Code allowing the key entered to validate

    I updated my previous.
    When you hit the enter key in the textbox, the value init will be displayed in a message box.

  6. #6

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Re: Code allowing the key entered to validate

    but me J made
    Private Sub Form1_KeyPress(ByVal sender As Object, ByVal E Have KeyEventArgs) Yew e.KeyCode = Keys.enter Then MsgBox("bonjour") End If End Sub
    then when I click on entry of keyboard it posts anything!!

  7. #7
    Fanatic Member
    Join Date
    Feb 2007
    Location
    Eindhoven
    Posts
    828

    Re: Code allowing the key entered to validate

    try this one

    vb Code:
    1. private sub form1_KeyDown(sender as object, e as KeyEventArgs) Handles KeyDown
    2.    messageBox.show("Bonjour")
    3. end sub

  8. #8

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Re: Code allowing the key entered to validate

    private sub form1_KeyDown(sender have object, E have KeyEventArgs) Handles KeyDown messageBox.show("Bonjour")end sub that it gives me anything!!

  9. #9

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Re: Code allowing the key entered to validate

    but a condition! I want that in vb.net 2003

  10. #10
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Code allowing the key entered to validate

    This is really confusing me.
    WHAT should react to keypress? A textbox? A form?
    What key should react to being pressed? The enter key?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  11. #11

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Re: Code allowing the key entered to validate

    me I want quite simply when I to fill the textbox and I click on entry of keyboard gives me a message

  12. #12
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Code allowing the key entered to validate

    Heres an example:

    VB.Net Code:
    1. Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    2.         If e.KeyCode = Keys.Return Then
    3.             MessageBox.Show("You pressed enter")
    4.         End If
    5.     End Sub
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  13. #13
    Fanatic Member
    Join Date
    Feb 2007
    Location
    Eindhoven
    Posts
    828

    Re: Code allowing the key entered to validate

    is there any difference between keys.Return and keys.Enter?

  14. #14

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    62

    Re: Code allowing the key entered to validate

    good with keys.return it goes t-pieces well then when I click on entry it posts me the message but with keys.enter No

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width