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. .NET (Core and Framework)
  4. Mimicking the AutoScroll functionality

Mimicking the AutoScroll functionality

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncsharpgraphicstutorial
1 Posts 1 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.
  • M Offline
    M Offline
    MikeBeard
    wrote on last edited by
    #1

    I am curious as to how the auto-scroll feature works in the .NET scrollable controls. How does it set the view-port into the virtual space of a control’s draw-able space? I understand how to do it if I have a definable space (say like using a bitmap etc. with defined unchanging bounds) but am not sure how to do this if the region I’m using is infinite with changing bounds. I have a situation where the width and height are fully scalable and dynamic with other controls (that know how to draw themselves in the proper place on their parent control) being “drawn” on the virtual area. I can get this to work with auto-scroll (I keep changing the AutoScrollMinSize as it changes) until I look at the requirement that another control above it (same width) has to scroll in lock-step for the horizontal scrolling. The documentation states that you can set the AutoScroll property to true and then optionally turn off the horizontal or vertical scroll bars by setting the protected members HScrollBar or VScrollBar to false. In practice, it doesn’t seem to work for me. If the AutoScrollMinSize property changes (which mine do constantly), it resets the values to true. At this point, even if I reset the variables back to false, they still show up regardless of how they were set and I have scroll bars where I don’t want them. Here are my questions: •Is there a way to make the auto vertical/horizontal scroll-bars stay invisible with AutoScroll turned on (like the documentation states)? •If not, what is the best way to override this functionality to mimic the auto-scroll functionality? I’d really like to not have to play with the WM_H/VSCROLL window messages. But if this is the best way, again, how do I change the view-port position into the virtual space I’m using? •Is there a better way? Thanks, Mike

    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