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. UP and DOWN keyboard event in MFC Application(Very Urgent)

UP and DOWN keyboard event in MFC Application(Very Urgent)

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicshelp
10 Posts 7 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.
  • A Offline
    A Offline
    AnithaSubramani
    wrote on last edited by
    #1

    HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

    V _ C D M 6 Replies Last reply
    0
    • A AnithaSubramani

      HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

      V Offline
      V Offline
      vicky00000
      wrote on last edited by
      #2

      Is it for selection change? Please explain your purpose

      A 1 Reply Last reply
      0
      • A AnithaSubramani

        HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

        _ Offline
        _ Offline
        _AnsHUMAN_
        wrote on last edited by
        #3

        I have started working on this issue. Once I get an acknowlegement for the amount transferred by you I will send you the code. Don't be surprised if it contains some bugs as it is being done on an URGENT basis. You must be having a class derived from CBitmapButton or CButton (or in whatever way you show bitmap on the button). Why don't you handle it there?

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        A 1 Reply Last reply
        0
        • V vicky00000

          Is it for selection change? Please explain your purpose

          A Offline
          A Offline
          AnithaSubramani
          wrote on last edited by
          #4

          yes, i need for selection change.

          V 1 Reply Last reply
          0
          • _ _AnsHUMAN_

            I have started working on this issue. Once I get an acknowlegement for the amount transferred by you I will send you the code. Don't be surprised if it contains some bugs as it is being done on an URGENT basis. You must be having a class derived from CBitmapButton or CButton (or in whatever way you show bitmap on the button). Why don't you handle it there?

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

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

            Im using 5 bitmap buttons and I need the UP and DOWN keyboard event for selection process.

            1 Reply Last reply
            0
            • A AnithaSubramani

              HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              AnithaSubramani wrote:

              Very Urgent.........

              Of course. :-D BTW this may help [^]. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              1 Reply Last reply
              0
              • A AnithaSubramani

                yes, i need for selection change.

                V Offline
                V Offline
                vicky00000
                wrote on last edited by
                #7

                is it just for selection process, No need to up and down key event.Do u want to do somthing when it selected?

                1 Reply Last reply
                0
                • A AnithaSubramani

                  HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

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

                  Perhaps you need to override PreTranslateMessage() like:

                  BOOL CMyDialog::PreTranslateMessage(MSG* pMsg)
                  {
                  if (WM_KEYDOWN == pMsg->message)
                  {
                  if (VK_UP == pMsg->wParam)
                  TRACE("You pressed the UP arrow.\n");
                  else if (VK_DOWN == pMsg->wParam)
                  TRACE("You pressed the DOWN arrow.\n");
                  }
                  else if (WM_KEYUP == pMsg->message)
                  {
                  if (VK_UP == pMsg->wParam)
                  TRACE("You released the UP arrow.\n");
                  else if (VK_DOWN == pMsg->wParam)
                  TRACE("You released the DOWN arrow.\n");
                  }

                  return CDialog::PreTranslateMessage(pMsg);
                  

                  }

                  "Love people and use things, not love things and use people." - Unknown

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  1 Reply Last reply
                  0
                  • A AnithaSubramani

                    HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #9

                    How can one be new to MFC and have a very urgent question? :)

                    Mark Salsbery Microsoft MVP - Visual C++ :java:

                    1 Reply Last reply
                    0
                    • A AnithaSubramani

                      HI All, Im new to MFC.I have done a Dialoged based GUI(Im using Bitmap Buttons).I need to use UP and DOWN keyboard event for that buttons.Help me.Very Urgent......... Thanks & Regards Anitha :)

                      S Offline
                      S Offline
                      Stephen Hewitt
                      wrote on last edited by
                      #10

                      A word of advice: don't use the word "urgent" when posting! If anything it results in slower responses or anger directed towards you.

                      Steve

                      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