Custom drawing all scrollbars in application

G

Guest

I am implementing an Office 2007 – like interface, including the ability to
change colors. One issue that I have is that scrollbars look poor if the
application color theme (e.g., Black) does not match the windows color theme
(e.g., Blue). So, I want to custom draw every scrollbar within my
application. The problem is that scrollbars can show up in many types of
controls that I use within my app, such as in Forms, TextBoxes, ComboBox
DropDowns, PictureBoxes, Panels, PropertyGrids or any other scrollable
control. Is it possible to custom draw the scrollbars for all of these
controls? If so, how?

Thanks for any help!
Lance
 
L

Linda Liu [MSFT]

Hi Lance,

Based on my understanding, you'd like to change the color of all scrollbars
in an application. If I'm off base, please feel free to let me know.

I think you need to change some system setting to do that. I searched the
KB and found an article saying that we could use SetSysColors API function
to set the system colors for various parts of the display in Microsoft
Windows. This allows you to change the Window display programmatically,
instead of using the Windows Control Panel. You may visit the following
link for more information.

'How to Set Windows System Colors Using API and Visual Basic'
http://support.microsoft.com/kb/82158

Note that you need to use platform invoke in VB.NET when you're going to
call the Win32 API--SetSysColors. You may visit the following link to get
information about how to use platform invoke in VB.NET.

'Using Platform Invoke'
http://www.codeproject.com/dotnet/PInvoke.asp

Hope this helps.
If you have any question, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Sebastian Wain

I am implementing an Office 2007 - like interface, including the ability to
change colors. One issue that I have is that scrollbars look poor if the
application color theme
...
...
...
Is it possible to custom draw the scrollbars for all of these
controls? If so, how?

It's not easy to do it completely, like the people of nullsoft
(winamp) did it.
You can see a deep article about it on: http://www.codeproject.com/
dialog/coolscroll.asp but it's not in .net.


Sebastian
 
G

Guest

Hi Sebastian,

Thanks a lot for the link. Definately the type of thing that I'm looking
for, but as you said, "deep".

Lance
 
G

Guest

Hi Linda,

Thank you for the info. Not quite what I was hoping to hear, but good to
know. Too bad that there isn't a way to limit the color change to your app.
I suspect that some of my users might get a little excited if I start mucking
around with their system colors.

Lance
 
H

Herfried K. Wagner [MVP]

ljlevend2 said:
I am implementing an Office 2007 – like interface, including the ability to
change colors. One issue that I have is that scrollbars look poor if the
application color theme (e.g., Black) does not match the windows color
theme
(e.g., Blue). So, I want to custom draw every scrollbar within my
application. The problem is that scrollbars can show up in many types of
controls that I use within my app, such as in Forms, TextBoxes, ComboBox
DropDowns, PictureBoxes, Panels, PropertyGrids or any other scrollable
control. Is it possible to custom draw the scrollbars for all of these
controls? If so, how?

I have seen an implementation that uses a patched "user32.dll" (IIRC) to
change the scrollbars' style for the whole system. However, I do not think
this is a clean solution, and it's unsupported too!
 
L

Linda Liu [MSFT]

Hi Lance,

Thank you for your feedback.

I am sorry to say that I don't think there's a easy way to change the color
of all the scrollbars in an application.

I think you may search for some 3rd-party product to do this.

If you need our further assistance, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!


Sincerely,
Linda Liu
Microsoft Online Community Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top