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. Question related to List box control.

Question related to List box control.

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 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
    Sameer_Thakur
    wrote on last edited by
    #1

    Hi all. How can I get the pointer/handle to the horizontal and vertical scroll bars from list box? I tried it using… CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST); if( NULL == pList->GetSafeHwnd() ) return; CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL. Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows? Thanks

    Sameer Thakur

    H P 2 Replies Last reply
    0
    • S Sameer_Thakur

      Hi all. How can I get the pointer/handle to the horizontal and vertical scroll bars from list box? I tried it using… CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST); if( NULL == pList->GetSafeHwnd() ) return; CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL. Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows? Thanks

      Sameer Thakur

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Sameer_Thakur wrote:

      CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL.

      Did you see MSDN? From the MSDN This member function does not operate on scroll bars created when the WS_HSCROLL or WS_VSCROLL bits are set during the creation of a window


      WhiteSky


      S 1 Reply Last reply
      0
      • H Hamid Taebi

        Sameer_Thakur wrote:

        CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL.

        Did you see MSDN? From the MSDN This member function does not operate on scroll bars created when the WS_HSCROLL or WS_VSCROLL bits are set during the creation of a window


        WhiteSky


        S Offline
        S Offline
        Sameer_Thakur
        wrote on last edited by
        #3

        Hi. Yes I saw that point mentioned in MSDN.. Thats why I asked for the method to get handle to the Scroll bars of Listbox. Is there any way to get it? Thanks -- modified at 4:47 Saturday 3rd March, 2007

        Sameer Thakur

        H 1 Reply Last reply
        0
        • S Sameer_Thakur

          Hi. Yes I saw that point mentioned in MSDN.. Thats why I asked for the method to get handle to the Scroll bars of Listbox. Is there any way to get it? Thanks -- modified at 4:47 Saturday 3rd March, 2007

          Sameer Thakur

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Can you say what do you need,excatly?


          WhiteSky


          S 1 Reply Last reply
          0
          • H Hamid Taebi

            Can you say what do you need,excatly?


            WhiteSky


            S Offline
            S Offline
            Sameer_Thakur
            wrote on last edited by
            #5

            Sure. In my application I have added a list box on a dialog box. This list contain so many numbers of string elements that user has to scroll too much to see all the contents. I want to minimize the scrolling efforts of user and I want to provide auto scrolling to the list box. The elements of the list box should get scroll automatically when user movies the mouse pointer over scroll bar arrows of the list box. For that I want to … 1. Get the pointer or handle to the Scroll bars of list control. 2. Trap the event when mouse is moved over the scroll bar arrows and kept there for some predefined time say 2 sec. 3. Scroll down or up the list with some specified speed. How I can proceed to achieve these sub tasks? Thanks

            Sameer Thakur

            H 1 Reply Last reply
            0
            • S Sameer_Thakur

              Hi all. How can I get the pointer/handle to the horizontal and vertical scroll bars from list box? I tried it using… CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST); if( NULL == pList->GetSafeHwnd() ) return; CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL. Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows? Thanks

              Sameer Thakur

              P Offline
              P Offline
              prasad_som
              wrote on last edited by
              #6

              Sameer_Thakur wrote:

              Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows?

              Look for CWnd::OnNcHitTest.

              Prasad Notifier using ATL | Operator new[],delete[][^]

              1 Reply Last reply
              0
              • S Sameer_Thakur

                Sure. In my application I have added a list box on a dialog box. This list contain so many numbers of string elements that user has to scroll too much to see all the contents. I want to minimize the scrolling efforts of user and I want to provide auto scrolling to the list box. The elements of the list box should get scroll automatically when user movies the mouse pointer over scroll bar arrows of the list box. For that I want to … 1. Get the pointer or handle to the Scroll bars of list control. 2. Trap the event when mouse is moved over the scroll bar arrows and kept there for some predefined time say 2 sec. 3. Scroll down or up the list with some specified speed. How I can proceed to achieve these sub tasks? Thanks

                Sameer Thakur

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                I have a suggestion for you disable VERT and HORZ of list and insert two static control for list and when use want to use of scrollbar use of static ontrol,but you can desgin apparent of these static like scrollbar and another my suggestion is better you use of listctrl instead listbox ;)


                WhiteSky


                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