Results 1 to 3 of 3

Thread: keyascii

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    keyascii

    I have a textbox that has the property set to mutiple lines. I'd like to diable the "enter" key in the key_press event...any suggestions?

    thanks
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    In the key press event of the text box do as follows:

    dim KeyAscii as integer
    KeyAscii = Asc(e.KeyChar)


    If KeyAscii = 13 then ' Enter key
    e.handled = true
    exit sub
    end if

    doesn't disable the enter key but sure as hell ignores it

    alternitvely use the same code but set

    e.handled to false in which case you simply get a horrible sounding bleep but the result is the same

    all you are doing there is to use the event arguements to control what is going on, using the standard event handler.Yes you could write and add your own event handler but I don't see much point in that on this occassion.
    Last edited by RichardAtherton; Oct 13th, 2003 at 03:16 PM.

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    thanks
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

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