Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What is the use of e.Handled in the KeyDown event

What is the use of e.Handled in the KeyDown event

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kalvin Work
    wrote on last edited by
    #1

    As far as I have been able to tell setting e.Handled to true does absolutely nothing. I'm wondering why it's even available for the KeyDown event. Could someone please tell me? I have looked at the documentation for the textbox control and the KeyDown checks the value and sets some class variable, then the KeyPress checks that variable and sets e.Handled based on the value of the variable. Thank you.

    - Kalvin

    L 1 Reply Last reply
    0
    • K Kalvin Work

      As far as I have been able to tell setting e.Handled to true does absolutely nothing. I'm wondering why it's even available for the KeyDown event. Could someone please tell me? I have looked at the documentation for the textbox control and the KeyDown checks the value and sets some class variable, then the KeyPress checks that variable and sets e.Handled based on the value of the variable. Thank you.

      - Kalvin

      L Offline
      L Offline
      loyal ginger
      wrote on last edited by
      #2

      If you derive a class from TextBox, handle KeyDown event, and set Handled to true, that control will not pass the key press events to the underlying Win32 text box control, but it will still display the characters that the user typed. Set it to false so that the underlying Win32 text box control can do the default handling.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups