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. Button down issue

Button down issue

Scheduled Pinned Locked Moved C#
helpcsharpdotnettutorial
5 Posts 3 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.
  • S Offline
    S Offline
    Soleil couchant
    wrote on last edited by
    #1

    I am designing a PDA application using the .NET CF, but I guess this issue would be the same irrespective of it being .NET Framework or .NET Compact Framework.. I have a button and I want to make it have like a button-down event. For example, a form has a mousedown and when the mouse button is down, there is an eventhandler mousedown for it. I want my button to do the same. Note that the mousedown event doesn't exist for a button. Even setting a mousedown event on the form which contains the button doesn't do the trick (clicking the button does not fire the mousedown event of the form).. what I want to do is have a facility in my application like while the button is being pressed (for example it can remain pressed for 5 seconds), keep changing the value of another control.. Any help would be highly appreciated. Cheers, David

    B M 2 Replies Last reply
    0
    • S Soleil couchant

      I am designing a PDA application using the .NET CF, but I guess this issue would be the same irrespective of it being .NET Framework or .NET Compact Framework.. I have a button and I want to make it have like a button-down event. For example, a form has a mousedown and when the mouse button is down, there is an eventhandler mousedown for it. I want my button to do the same. Note that the mousedown event doesn't exist for a button. Even setting a mousedown event on the form which contains the button doesn't do the trick (clicking the button does not fire the mousedown event of the form).. what I want to do is have a facility in my application like while the button is being pressed (for example it can remain pressed for 5 seconds), keep changing the value of another control.. Any help would be highly appreciated. Cheers, David

      B Offline
      B Offline
      blackjack2150
      wrote on last edited by
      #2

      What if you use the mouse down event and check for the position of the cursor to be inside your button. Wouldn't that have the same outcome?

      S 1 Reply Last reply
      0
      • B blackjack2150

        What if you use the mouse down event and check for the position of the cursor to be inside your button. Wouldn't that have the same outcome?

        S Offline
        S Offline
        Soleil couchant
        wrote on last edited by
        #3

        I thought of that too.. But it doesn't help.. because when you click the button, the mousedown event of the form doesn't get fired

        1 Reply Last reply
        0
        • S Soleil couchant

          I am designing a PDA application using the .NET CF, but I guess this issue would be the same irrespective of it being .NET Framework or .NET Compact Framework.. I have a button and I want to make it have like a button-down event. For example, a form has a mousedown and when the mouse button is down, there is an eventhandler mousedown for it. I want my button to do the same. Note that the mousedown event doesn't exist for a button. Even setting a mousedown event on the form which contains the button doesn't do the trick (clicking the button does not fire the mousedown event of the form).. what I want to do is have a facility in my application like while the button is being pressed (for example it can remain pressed for 5 seconds), keep changing the value of another control.. Any help would be highly appreciated. Cheers, David

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          What makes you think the MouseDown event doesn't exist for a Button? According to the documentation, the MouseUp and MouseDown events are part of the Control class and supported in CF 1.0 and 2.0 as well. Since Button inherits from Control, these events do exist.

          Regards, mav -- Black holes are the places where God divided by 0...

          S 1 Reply Last reply
          0
          • M mav northwind

            What makes you think the MouseDown event doesn't exist for a Button? According to the documentation, the MouseUp and MouseDown events are part of the Control class and supported in CF 1.0 and 2.0 as well. Since Button inherits from Control, these events do exist.

            Regards, mav -- Black holes are the places where God divided by 0...

            S Offline
            S Offline
            Soleil couchant
            wrote on last edited by
            #5

            Well.. I can't find them in the property window of the button. I have KeyDown, KeyUp and a bunch of other events but not MouseDown and MouseUp.

            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