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. SetScrollInfo

SetScrollInfo

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

    Hello! It seems to me that setscrollinfo both updates the position of the thumb and scrolls the window. this annoys me very much because I want to scroll the window, and setscrollpos just ruins everything.. Is there a function that only sets the position of the thumb? I'm using mfc.

    J D 2 Replies Last reply
    0
    • P pie

      Hello! It seems to me that setscrollinfo both updates the position of the thumb and scrolls the window. this annoys me very much because I want to scroll the window, and setscrollpos just ruins everything.. Is there a function that only sets the position of the thumb? I'm using mfc.

      J Offline
      J Offline
      Johan Rosengren
      wrote on last edited by
      #2

      You could try calling the API-version ::SetScrollInfo.

      1 Reply Last reply
      0
      • P pie

        Hello! It seems to me that setscrollinfo both updates the position of the thumb and scrolls the window. this annoys me very much because I want to scroll the window, and setscrollpos just ruins everything.. Is there a function that only sets the position of the thumb? I'm using mfc.

        D Offline
        D Offline
        darkbyte
        wrote on last edited by
        #3

        If i recall, position of the thumb is always relative to other information. if Min is 0 and Max is 100, and pos is 50, then thumb position will be 50%. The scrollbar is probably attached to the document you're viewing so its normal that changing the pos or scrollinfo will move the view of the document. Why are you trying to change only the thumb position ? DarkByte

        P 1 Reply Last reply
        0
        • D darkbyte

          If i recall, position of the thumb is always relative to other information. if Min is 0 and Max is 100, and pos is 50, then thumb position will be 50%. The scrollbar is probably attached to the document you're viewing so its normal that changing the pos or scrollinfo will move the view of the document. Why are you trying to change only the thumb position ? DarkByte

          P Offline
          P Offline
          pie
          wrote on last edited by
          #4

          Because I'm writing an application that behaves like mspaint, and I use SetViewportOrg for scrolling.. Do you have a better suggestion?

          D 1 Reply Last reply
          0
          • P pie

            Because I'm writing an application that behaves like mspaint, and I use SetViewportOrg for scrolling.. Do you have a better suggestion?

            D Offline
            D Offline
            darkbyte
            wrote on last edited by
            #5

            How about you create the scrollbar yourself instead of relying on the scrollbars of the window. You could even subclass the scrollbar to add your behavior. Other possibility is to control the repainting behavior so that you decide yourself when you try to repaint offsetted and when you dont. There's probably many other different ways, but they all involve changing some default behavior somwhere. DarkByte

            P 1 Reply Last reply
            0
            • D darkbyte

              How about you create the scrollbar yourself instead of relying on the scrollbars of the window. You could even subclass the scrollbar to add your behavior. Other possibility is to control the repainting behavior so that you decide yourself when you try to repaint offsetted and when you dont. There's probably many other different ways, but they all involve changing some default behavior somwhere. DarkByte

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

              Okay.. I just talked to a guy, who told me that I shouldn't be using CScrollView, because it behaves differently from other views. And true enough. When I switched to a standard CView, SetScrollPos didn't scroll my window anymore. I think that's werid.

              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