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. scollbar question

scollbar question

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphics
2 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.
  • D Offline
    D Offline
    dan o
    wrote on last edited by
    #1

    hi, I have a formview (in splitter window) after OnInitialUpdate() i do a load bitmap, but the size of bitmap is greater than the form i like to draw scrollbars of the formview m_static_picture.GetWindowRect(&rect); //beholder of bitmap GetWindowRect(&rectWindow); if(rectWindow.bottom < rect.bottom) { //to small a scroll bar is needed int cx = rectWindow.Width(); int cy = rectWindow.Height(); int iDif = rect.bottom - rectWindow.bottom; cy += iDif; ScreenToClient(&rectWindow); SetWindowPos(this, 0, 0, cx, cy, SWP_NOMOVE); } i wonder why this code is not working (i see no scollbar) even if after adding SCROLLINFO si; GetScrollInfo(SB_VERT,&si); si.nMin = 0; si.nPage = rectWindow.Height(); si.nMax = cy; si.nPos = 0; si.nTrackPos = 0; si.fMask = SIF_ALL; si.cbSize = sizeof(si); SetScrollInfo(SB_VERT, &si, TRUE); ShowScrollBar(SB_VERT, TRUE); give no result, any ideas?? dan oudijk :confused:

    L 1 Reply Last reply
    0
    • D dan o

      hi, I have a formview (in splitter window) after OnInitialUpdate() i do a load bitmap, but the size of bitmap is greater than the form i like to draw scrollbars of the formview m_static_picture.GetWindowRect(&rect); //beholder of bitmap GetWindowRect(&rectWindow); if(rectWindow.bottom < rect.bottom) { //to small a scroll bar is needed int cx = rectWindow.Width(); int cy = rectWindow.Height(); int iDif = rect.bottom - rectWindow.bottom; cy += iDif; ScreenToClient(&rectWindow); SetWindowPos(this, 0, 0, cx, cy, SWP_NOMOVE); } i wonder why this code is not working (i see no scollbar) even if after adding SCROLLINFO si; GetScrollInfo(SB_VERT,&si); si.nMin = 0; si.nPage = rectWindow.Height(); si.nMax = cy; si.nPos = 0; si.nTrackPos = 0; si.fMask = SIF_ALL; si.cbSize = sizeof(si); SetScrollInfo(SB_VERT, &si, TRUE); ShowScrollBar(SB_VERT, TRUE); give no result, any ideas?? dan oudijk :confused:

      L Offline
      L Offline
      lucy 0
      wrote on last edited by
      #2

      after you loaded your bmp, if the image dimesion of this bmp is imageWidth x imageHeight, try the following code: CSize sizeTotal; sizeTotal.cx = imageWidth; sizeTotal.cy = imageHeight; SetScrollSizes(MM_TEXT, sizeTotal);

      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