• 0

[c#] scrollbar colors/style


Question

Yes, I am back with another problems google failed to help me on :( I have a form with autoscroll enabled...which is how i would prefer it (though if push comes to shove...i can put in my own scroll bar)...

The default look to the scroll bar does not fit my app at all...i would like to be able to make it flat style, or at least change its colors...

the System.Windows.Forms.ScrollBar.(color stuff) is all read only, and i probably wouldnt want to change those anyways (i dont know if itd mess up my systems actualy color settings?)...but being flat and changing the color of it would be great...

but from what i can tell...unless i built my own scroll bar from scratch...i cant do this :( Is there some nice way of doing it?

Thanks once again!!

-Doug

Link to comment
https://www.neowin.net/forum/topic/282516-c-scrollbar-colorsstyle/
Share on other sites

8 answers to this question

Recommended Posts

  • 0
  gameguy said:
Both ScrollBar.BackColor and ScrollBar.ForeColor are read and write (Y)

585435710[/snapback]

How would I access those? Those do not exist in System.Windows.Forms.ScrollBar ...or is this if I put my own scrollbar in, i get more properties than autoscroll to change? can you give an example? I tried putting in my own scroll bar too and I didnt see backcolor or forecolor...

thanks

  • 0
  SkyyPunk said:
How would I access those?  Those do not exist in System.Windows.Forms.ScrollBar ...or is this if I put my own scrollbar in, i get more properties than autoscroll to change?  can you give an example?  I tried putting in my own scroll bar too and I didnt see backcolor or forecolor...

thanks

585436178[/snapback]

It's really odd you can't see the properties. They are there, and they are both get/set.

<edit>OK. You can't see them in design time, but you can set the colors at runtime.

<edit 2>

Uh... well, they sure are insistent that they stay the some color. You'll probably have to do all your own painting. Or you could subclass the scrollbars, and set the style to user paint ORed with AllPaintingInWmPaint. Maybe that will help.

Edited by weenur
  • 0
  Menge said:
  .Net 1.1 Documentation said:
You typically do not inherit directly from ScrollBar. To create your own scroll bar class, inherit from the VScrollBar or HScrollBar class.

Inherit the VScrollBar or the HScrollBar instead :)

585438439[/snapback]

That's what I meant, but I guess I should be more explicit.

  • 0

well...i think i am going to put this off for now...i already had enough fun making my own button class modifications...

I set the forecolors/backcolors of it, and i thought maybe it ignored it like mdiparents ignore backcolor and take it from the system default...so i did what i did to get my parent forms backcolor changed...didnt work...i then put up a messagebox displaying what it said was set for its backcolor and forecolor...sure enough it said what i set it to, but the scrollbar did not use those apparently...(i guess similar to its backgroundimage and alike...)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • It's like I said: people need to bitch about literally anything these days. It's just a freaking stupid thumbnail.
    • Hullucination may be a sign of a more serious condition like schizophrenia or dementia.
    • That trigger travel before actuation is a major turn off for me.
    • This ChatGPT & Automation E-Degree has been price dropped even further by Steven Parker Today's highlighted deal comes via our Online Courses section of the Neowin Deals store, where for only a limited time you can save 97% on this ChatGPT & Automation E-Degree. Immerse yourself in a transformative learning experience with these 12 captivating courses, featuring over 25 hours of engaging content that will redefine the way you perceive the digital landscape. Embrace the future with ChatGPT and unlock the potential of more than 20 indispensable AI tools tailored for today's dynamic challenges in marketing, business, and coding. Embark on a journey of skill enhancement and future-proof your career with our e-degree. Get ready to shape the future with knowledge, innovation, and the best AI tools available today! Access 12 lectures & 25 hours of content 24/7 Explore practical applications & real-world scenarios tailored to your professional domain Gain valuable experience that can be directly applied to your professional endeavors Learn the art of customization as you tailor ChatGPT to meet the unique demands of various industries Unleash your full potential in diverse professional settings Master the art of streamlining business processes through automation, enhancing efficiency, and ensuring optimal resource utilization Gain insights into powerful techniques that transform raw data into compelling visual narratives Discover how AI can amplify your creativity & contribute to groundbreaking projects Elevate your communication skills by mastering conversations with ChatGPT Explore the intersection of AI & data visualization Gray Scale Photo of Gears via PexelsGood to know Length of time users can access this course: lifetime Access options: desktop & mobile Redemption deadline: redeem your code within 30 days of purchase Experience level required: beginner Updates included Certificate of Completion ONLY Lifetime access to the ChatGPT & Automation E-Degree normally costs $790, but you can pick it up for just $19.97 for a limited time, that's a saving of $770 (97%) off the normal price! For full details, terms, and instructor info for the above courses, click the link below. Get this ChatGPT & Automation E-Degree course for just $19.97, or learn more Although priced in U.S. dollars, this deal is available for digital purchase worldwide. We post these because we earn commission on each sale so as not to rely solely on advertising, which many of our readers block. It all helps toward paying staff reporters, servers and hosting costs. Other ways to support Neowin Whitelist Neowin by not blocking our ads Create a free member account to see fewer ads Make a donation to support our day to day running costs Subscribe to Neowin - for $14 a year, or $28 a year for an ad-free experience Disclosure: Neowin benefits from revenue of each sale made through our branded deals site powered by StackCommerce.
  • Recent Achievements

    • Community Regular
      Primey_ went up a rank
      Community Regular
    • Reacting Well
      Gromvar earned a badge
      Reacting Well
    • Dedicated
      BreakingBenjamin earned a badge
      Dedicated
    • Week One Done
      Hartej earned a badge
      Week One Done
    • One Year In
      TsunadeMama earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      521
    2. 2
      +FloatingFatMan
      180
    3. 3
      ATLien_0
      166
    4. 4
      Skyfrog
      105
    5. 5
      Som
      98
  • Tell a friend

    Love Neowin? Tell a friend!