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. Scrollbar range

Scrollbar range

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelptutorialquestion
4 Posts 2 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
    Aint
    wrote on last edited by
    #1

    Hi. I have set the scrollbar range from 0 to 9900 to accomodate the original graph. But I have a few radio buttons which reduce the size of the graph. The problem is when I reduce the size of the graph and scroll right to the back of the graph, there is this empty space. I know the scrollbar range is smaller but how to I change this range when the radio button is clicked? Thanks.

    N 1 Reply Last reply
    0
    • A Aint

      Hi. I have set the scrollbar range from 0 to 9900 to accomodate the original graph. But I have a few radio buttons which reduce the size of the graph. The problem is when I reduce the size of the graph and scroll right to the back of the graph, there is this empty space. I know the scrollbar range is smaller but how to I change this range when the radio button is clicked? Thanks.

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      Hi, try this: CSize sizeTotal; sizeTotal.cx = ????; sizeTotal.cy = ????; SetScrollSizes(MM_TEXT, sizeTotal); Where the ???? put the values you need.

      Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

      A 1 Reply Last reply
      0
      • N Nelek

        Hi, try this: CSize sizeTotal; sizeTotal.cx = ????; sizeTotal.cy = ????; SetScrollSizes(MM_TEXT, sizeTotal); Where the ???? put the values you need.

        Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

        A Offline
        A Offline
        Aint
        wrote on last edited by
        #3

        but this can only be used if you are using CScrollview? Im using CFormView with a scrollbar control, used to control a picture control.

        N 1 Reply Last reply
        0
        • A Aint

          but this can only be used if you are using CScrollview? Im using CFormView with a scrollbar control, used to control a picture control.

          N Offline
          N Offline
          Nelek
          wrote on last edited by
          #4

          Ok, I thought that would make you think a bit :P From VC++ Help: CScrollBar::SetScrollRange void SetScrollRange( int nMinPos, int nMaxPos, BOOL bRedraw = TRUE ); Parameters nMinPos: Specifies the minimum scrolling position. nMaxPos: Specifies the maximum scrolling position. bRedraw: Specifies whether the scroll bar should be redrawn to reflect the change. If bRedraw is TRUE, the scroll bar is redrawn; if FALSE, it is not redrawn. It is redrawn by default. And when you check your radio button, set it another time with bRedraw TRUE to force the redraw of the scrollbar

          Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

          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