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 Long Click

Button Long Click

Scheduled Pinned Locked Moved C#
json
11 Posts 8 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.
  • E Eli Nurman

    Hi People. I wonder if any of you have used a API that can detect if a button is still being clicked. Meaning, my button scrolls a ListView but i must click again and again to scroll down one Item after each other, i wonder how i can make it like the regular scrollbar that you can keep the click and it will scroll. Please advice. Thanks.

    D Offline
    D Offline
    DaveyM69
    wrote on last edited by
    #2

    I don't know of any API for it but shouldn't be too hard to code this by checking the mouse coordinates on the tick of a timer that can be started on MouseDown and stopped on MouseUp and MouseLeave

    Dave

    If this helped, please vote & accept answer!

    Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
    BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

    E 1 Reply Last reply
    0
    • D DaveyM69

      I don't know of any API for it but shouldn't be too hard to code this by checking the mouse coordinates on the tick of a timer that can be started on MouseDown and stopped on MouseUp and MouseLeave

      Dave

      If this helped, please vote & accept answer!

      Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

      E Offline
      E Offline
      Eli Nurman
      wrote on last edited by
      #3

      Thanks dave. But i'm sure there is a more simple solutions for this

      T K 2 Replies Last reply
      0
      • E Eli Nurman

        Thanks dave. But i'm sure there is a more simple solutions for this

        T Offline
        T Offline
        T M Gray
        wrote on last edited by
        #4

        Actually using MouseDown instead of Click is a pretty simple answer. What do you find so complicated about it?

        1 Reply Last reply
        0
        • E Eli Nurman

          Hi People. I wonder if any of you have used a API that can detect if a button is still being clicked. Meaning, my button scrolls a ListView but i must click again and again to scroll down one Item after each other, i wonder how i can make it like the regular scrollbar that you can keep the click and it will scroll. Please advice. Thanks.

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #5

          In WPF, there is the RepeatButton. In Windows Forms, you can make a custom RepeatButton.

          [Forum Guidelines]

          1 Reply Last reply
          0
          • E Eli Nurman

            Hi People. I wonder if any of you have used a API that can detect if a button is still being clicked. Meaning, my button scrolls a ListView but i must click again and again to scroll down one Item after each other, i wonder how i can make it like the regular scrollbar that you can keep the click and it will scroll. Please advice. Thanks.

            A Offline
            A Offline
            AspDotNetDev
            wrote on last edited by
            #6

            Also, I should mention that you can place a WPF control in a Windows Form application, but you then require .Net 3.0 or greater on the computer the application gets deployed to (normally, you'd only require .Net 2.0 or greater for Windows Form applications).

            [Forum Guidelines]

            realJSOPR 1 Reply Last reply
            0
            • A AspDotNetDev

              Also, I should mention that you can place a WPF control in a Windows Form application, but you then require .Net 3.0 or greater on the computer the application gets deployed to (normally, you'd only require .Net 2.0 or greater for Windows Form applications).

              [Forum Guidelines]

              realJSOPR Offline
              realJSOPR Offline
              realJSOP
              wrote on last edited by
              #7

              It's not worth the complexity of adding the WPF control to a winforms app. It's much simpler just to create the custom button object.

              .45 ACP - because shooting twice is just silly
              -----
              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

              1 Reply Last reply
              0
              • E Eli Nurman

                Hi People. I wonder if any of you have used a API that can detect if a button is still being clicked. Meaning, my button scrolls a ListView but i must click again and again to scroll down one Item after each other, i wonder how i can make it like the regular scrollbar that you can keep the click and it will scroll. Please advice. Thanks.

                W Offline
                W Offline
                William Winner
                wrote on last edited by
                #8

                I have to agree with Davey...the simple solution is to use the MouseDown. Start a Timer on MouseDown and every tic of the timer, scroll down one. On MouseUp, stop the Timer. That's really a pretty simple solution.

                1 Reply Last reply
                0
                • E Eli Nurman

                  Thanks dave. But i'm sure there is a more simple solutions for this

                  K Offline
                  K Offline
                  Kevin Marois
                  wrote on last edited by
                  #9

                  Apparently you're not

                  Everything makes sense in someone's mind

                  1 Reply Last reply
                  0
                  • E Eli Nurman

                    Hi People. I wonder if any of you have used a API that can detect if a button is still being clicked. Meaning, my button scrolls a ListView but i must click again and again to scroll down one Item after each other, i wonder how i can make it like the regular scrollbar that you can keep the click and it will scroll. Please advice. Thanks.

                    R Offline
                    R Offline
                    Ravi Bhavnani
                    wrote on last edited by
                    #10

                    Here's a (VB .NET) AutoRepeat Button[^]. /ravi

                    My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                    1 Reply Last reply
                    0
                    • E Eli Nurman

                      Hi People. I wonder if any of you have used a API that can detect if a button is still being clicked. Meaning, my button scrolls a ListView but i must click again and again to scroll down one Item after each other, i wonder how i can make it like the regular scrollbar that you can keep the click and it will scroll. Please advice. Thanks.

                      E Offline
                      E Offline
                      Eli Nurman
                      wrote on last edited by
                      #11

                      Thanks guys, Issue Solved

                      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