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. Notifiation Messages for CSpinButtonCtrl in MFC

Notifiation Messages for CSpinButtonCtrl in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helptutorialcareer
1 Posts 1 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
    Sampath579
    wrote on last edited by
    #1

    Hi I created a control in my MFC application as follows:

    CSpinButtonCtrl m_spin;
    m_spin.Create(UDS_HORZ, CRect(0, 0, 50, 50), this, 1011);
    m_spin.ShowWindow(1);

    which created a spin control with two button with left arrow and right arrow. Now i want to perform some job based on the user clicks on these two buttons. I tried by adding notification message in Message map as follows:

    ON_NOTIFY(NM_CLICK, IDC_SPIN1, OnDropDown)

    I tried with some other options in the ON_NOTIFY message but my function OnDropDown dint get hit in any case. Later i tried adding the ON_WM_HSCROLL() into my message map and finally it worked. It came inside my function OnDropDown(). But the problem is i want to know which button (left/right) user clicked. Based on the button (left/right) i want to perform some operation. But in

    OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)

    funtion, the nSBCode is 4 and 8 everytime when i click left or right arrow. How to differentiate the left click and right click? May i know what is the exact message that should pass in Message map ?

    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