CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: KeyAscii = 0

  1. #1
    Join Date
    Aug 2007
    Posts
    445

    KeyAscii = 0

    hi everyone,
    i use this code in VB for not to type anything in the TextBox on keypress event
    Code:
    KeyAscii = 0
    how this code can be changed in VB.Net ?
    i tried
    Code:
    e.KeyChar = 0
    but does not work

    please rate the post if this is useful. And also never forget to mark the thread as [Resolved] when your problem is solved

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: KeyAscii = 0

    You could use e.Handled = True

  3. #3
    Join Date
    May 2008
    Posts
    224

    Re: KeyAscii = 0

    Quote Originally Posted by chunks
    hi everyone,
    i use this code in VB for not to type anything in the TextBox on keypress event
    Code:
    KeyAscii = 0
    how this code can be changed in VB.Net ?
    i tried
    Code:
    e.KeyChar = 0
    but does not work
    Dot net uses the actual character rather than the numeric code for the character.

    Code:
    e.keychar=chr(0)

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

Featured