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. About scrollbar of CScrollView

About scrollbar of CScrollView

Scheduled Pinned Locked Moved C / C++ / MFC
c++
6 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.
  • C Offline
    C Offline
    cash576
    wrote on last edited by
    #1

    CScrollView is a derived class of MFC supporting scroll.When size of document is bigger than size ofviewport,CScrollView will display scroll automatially. How can Hide the scrollbar(s) and i can still scroll the view by such as mousewheel events in this case. Is there any derived class of Cview to complete the same function(supporting scroll but not showing the scrollbar).

    P 1 Reply Last reply
    0
    • C cash576

      CScrollView is a derived class of MFC supporting scroll.When size of document is bigger than size ofviewport,CScrollView will display scroll automatially. How can Hide the scrollbar(s) and i can still scroll the view by such as mousewheel events in this case. Is there any derived class of Cview to complete the same function(supporting scroll but not showing the scrollbar).

      P Offline
      P Offline
      Peter Ritchie
      wrote on last edited by
      #2

      Why in the world would you want to contradict standard Windows usability and provide scrolling without a scrollbar? Why would your users want to re-learn how to scroll, just for your application? Then, have to deal with different mouse gestures as they switch between your applications and all other Windows applications? What happens if your users don't have mouse with a scroll wheel? CScrollView-derived views cannot simply have their scroll bars "hidden"; they are integral to the window. You would probably have to override the non-client size calculations and drawing. PeterRitchie.com

      C 1 Reply Last reply
      0
      • P Peter Ritchie

        Why in the world would you want to contradict standard Windows usability and provide scrolling without a scrollbar? Why would your users want to re-learn how to scroll, just for your application? Then, have to deal with different mouse gestures as they switch between your applications and all other Windows applications? What happens if your users don't have mouse with a scroll wheel? CScrollView-derived views cannot simply have their scroll bars "hidden"; they are integral to the window. You would probably have to override the non-client size calculations and drawing. PeterRitchie.com

        C Offline
        C Offline
        cash576
        wrote on last edited by
        #3

        In fact, i want to own a style like ACDsee viewer, users can move the content by drag mouse, but not by scroll the scrollbars. In my derived class of CScrollView, i have complete for it, but i cann't get rid of the scrollbars, it ocuppy the area of use's content.

        P 1 Reply Last reply
        0
        • C cash576

          In fact, i want to own a style like ACDsee viewer, users can move the content by drag mouse, but not by scroll the scrollbars. In my derived class of CScrollView, i have complete for it, but i cann't get rid of the scrollbars, it ocuppy the area of use's content.

          P Offline
          P Offline
          PJ Arends
          wrote on last edited by
          #4

          Then just use CView and handle all the scrolling yourself.


          "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


          Honoured as one of The Most Helpful Members of 2004

          C 1 Reply Last reply
          0
          • P PJ Arends

            Then just use CView and handle all the scrolling yourself.


            "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


            Honoured as one of The Most Helpful Members of 2004

            C Offline
            C Offline
            cash576
            wrote on last edited by
            #5

            Is there any derived class from CView in existence?

            P 1 Reply Last reply
            0
            • C cash576

              Is there any derived class from CView in existence?

              P Offline
              P Offline
              PJ Arends
              wrote on last edited by
              #6

              CView is derived from CWnd and is the base class of CScrollView and CCtrlView. Since what you are asking for is non-standard behaviour I doubt there is a readily available class that does what you want, but there might be if you search long and hard enough. You said you had it working with CScrollView, just the scroll bars were giving you trouble. It shouldn't be too difficult to derive a class from CView that does what you want. Just take the parts from CScrollView that you can use, and ignore or modify the parts you can't use.


              "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


              Honoured as one of The Most Helpful Members of 2004

              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