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 / C++ / MFC
  4. How to handle changes to a Slider bar by Keyboard

How to handle changes to a Slider bar by Keyboard

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
9 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.
  • R Offline
    R Offline
    reza matinnejad
    wrote on last edited by
    #1

    i have a slider bar and i have used onreleasedsliderbar event to handle its changes. but it is not fired when Keyboard is used to change the bar. How could i handle changes to Slider bar by Keyboard ?

    D I 2 Replies Last reply
    0
    • R reza matinnejad

      i have a slider bar and i have used onreleasedsliderbar event to handle its changes. but it is not fired when Keyboard is used to change the bar. How could i handle changes to Slider bar by Keyboard ?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What compiler are you using? Is MFC involved?


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      R 1 Reply Last reply
      0
      • D David Crow

        What compiler are you using? Is MFC involved?


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        R Offline
        R Offline
        reza matinnejad
        wrote on last edited by
        #3

        it is a visual c++ MFC project in Visual Studio .net 2003 IDE.

        D 1 Reply Last reply
        0
        • R reza matinnejad

          it is a visual c++ MFC project in Visual Studio .net 2003 IDE.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Ok, what message are you responding to?


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          R 1 Reply Last reply
          0
          • D David Crow

            Ok, what message are you responding to?


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            R Offline
            R Offline
            reza matinnejad
            wrote on last edited by
            #5

            just OnNMReleasedCaptureSlider from slider events, but also OnMouseMove but not KeyStroke events.

            R D 2 Replies Last reply
            0
            • R reza matinnejad

              just OnNMReleasedCaptureSlider from slider events, but also OnMouseMove but not KeyStroke events.

              R Offline
              R Offline
              reza matinnejad
              wrote on last edited by
              #6

              I want to handle changes to a slider bar which are made by a keyboard!

              1 Reply Last reply
              0
              • R reza matinnejad

                just OnNMReleasedCaptureSlider from slider events, but also OnMouseMove but not KeyStroke events.

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Why not use Spy++ to see which of the NM_xxx notification messages are being sent (when the keyboard is used with that control)?


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "Judge not by the eye but by the heart." - Native American Proverb

                R 1 Reply Last reply
                0
                • D David Crow

                  Why not use Spy++ to see which of the NM_xxx notification messages are being sent (when the keyboard is used with that control)?


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  R Offline
                  R Offline
                  reza matinnejad
                  wrote on last edited by
                  #8

                  I did use Spy, but there are just Key_Down and Key_Up Events. Would you think there is another way except handle Key_Down or Key_Up events?

                  1 Reply Last reply
                  0
                  • R reza matinnejad

                    i have a slider bar and i have used onreleasedsliderbar event to handle its changes. but it is not fired when Keyboard is used to change the bar. How could i handle changes to Slider bar by Keyboard ?

                    I Offline
                    I Offline
                    Iain Clarke Warrior Programmer
                    wrote on last edited by
                    #9

                    Did a quick search on MSDN, and found the following article: Trackbar Controls[^] Scrolling down, it tells you about the notification messages. It behaves just like a scroll bar, and sends WM_HSCROLL, or WM_VSCROLL as appropriate. You will want to use WM_xSCROLL / TB_ENDTRACK. It is sent when you use both keyboard and mouse. I hope this puts you on the right path, Iain.

                    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