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#
  4. Scrolling a panel via code (without its scrollbars) problem [modified]

Scrolling a panel via code (without its scrollbars) problem [modified]

Scheduled Pinned Locked Moved C#
helpquestionlearning
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.
  • 3 Offline
    3 Offline
    3Dizard
    wrote on last edited by
    #1

    What i have is a panel (in a windows form, let's call it mypanel) with no active scrollbars (autoscroll set to false). I don't need them and I don't want them to appear. In my code I use mypanel.HorizontalScroll.Value = value to scroll the panel. This code appears in the scroll event of another scrollbar in the form. This works fine, except one thing. When I move the slider of the other scrollbar mypanel of course gets repainted. But when repainting the scrollbars of mypanel are painted, too. Of course this is a temporary effect, because they disappear later in the painting cycle. So a painting cycle looks like this: Scrollbars painted, scrollbars removed, .... And this over and over cause I'm dragging a slider so the sroll event occurs many times. This leads to flickering when dragging the slider. So how can I get rid of the scrollbars in mypanel getting painted? Of course I could move the objects in mypanel manually without using the horizontal scroll, but this would be a worse solution. So any help is appreciated. -- modified at 14:28 Sunday 4th June, 2006

    D 1 Reply Last reply
    0
    • 3 3Dizard

      What i have is a panel (in a windows form, let's call it mypanel) with no active scrollbars (autoscroll set to false). I don't need them and I don't want them to appear. In my code I use mypanel.HorizontalScroll.Value = value to scroll the panel. This code appears in the scroll event of another scrollbar in the form. This works fine, except one thing. When I move the slider of the other scrollbar mypanel of course gets repainted. But when repainting the scrollbars of mypanel are painted, too. Of course this is a temporary effect, because they disappear later in the painting cycle. So a painting cycle looks like this: Scrollbars painted, scrollbars removed, .... And this over and over cause I'm dragging a slider so the sroll event occurs many times. This leads to flickering when dragging the slider. So how can I get rid of the scrollbars in mypanel getting painted? Of course I could move the objects in mypanel manually without using the horizontal scroll, but this would be a worse solution. So any help is appreciated. -- modified at 14:28 Sunday 4th June, 2006

      D Offline
      D Offline
      Dan Neilsen
      wrote on last edited by
      #2

      I did this using a datagrid but the same result will apply. Make an inherited user control that inherits the panel and simply set the width of the vertical scrollbar to 0 (and the height of the horizontal scrollbar). This should give you the hidden scrollbar effect that you want.

      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