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. problem with richtextbox Keypress Event

problem with richtextbox Keypress Event

Scheduled Pinned Locked Moved C#
questionhelp
3 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.
  • D Offline
    D Offline
    DKalepu
    wrote on last edited by
    #1

    Hi All, I am handling keypress event for a RichTextBix control on my windows form. But, when i press a key on it, why its entering two times into keypress event code instead of once.?? I have added event handler only once on my form. could anyone please suggest me how can I overcome this problem? Thanks, Durga.

    Strength is life, Weakness is death. --- Swami vivekananda

    T 1 Reply Last reply
    0
    • D DKalepu

      Hi All, I am handling keypress event for a RichTextBix control on my windows form. But, when i press a key on it, why its entering two times into keypress event code instead of once.?? I have added event handler only once on my form. could anyone please suggest me how can I overcome this problem? Thanks, Durga.

      Strength is life, Weakness is death. --- Swami vivekananda

      T Offline
      T Offline
      telha
      wrote on last edited by
      #2

      The delegate that handles the event raised has the invocation list of the methods to be called. It could be a reason that the code where the event is registered is called twice in the code execution, so check that out; the statement '+=' should be called only once when the form is loaded and the controls are created and added to it.

      Muhammad Talha

      D 1 Reply Last reply
      0
      • T telha

        The delegate that handles the event raised has the invocation list of the methods to be called. It could be a reason that the code where the event is registered is called twice in the code execution, so check that out; the statement '+=' should be called only once when the form is loaded and the controls are created and added to it.

        Muhammad Talha

        D Offline
        D Offline
        DKalepu
        wrote on last edited by
        #3

        Hi, thanks for the reply. I'm sorry that it was my problem i added the event handler twice inadvertently.

        Strength is life, Weakness is death. --- Swami vivekananda

        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