PC Review


Reply
Thread Tools Rate Thread

Custom drawing all scrollbars in application

 
 
=?Utf-8?B?bGpsZXZlbmQy?=
Guest
Posts: n/a
 
      7th Feb 2007
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

 
Reply With Quote
 
 
 
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      8th Feb 2007
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/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

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

 
Reply With Quote
 
Sebastian Wain
Guest
Posts: n/a
 
      8th Feb 2007
On Feb 7, 6:10 pm, ljlevend2 <ljleve...@nospam.nospam> wrote:
> 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
--
Sebastian R. Wain
Nektra Advanced Computing
http://www.nektra.com



 
Reply With Quote
 
=?Utf-8?B?bGpsZXZlbmQy?=
Guest
Posts: n/a
 
      9th Feb 2007
Hi Sebastian,

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

Lance

 
Reply With Quote
 
=?Utf-8?B?bGpsZXZlbmQy?=
Guest
Posts: n/a
 
      9th Feb 2007
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

 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Feb 2007
"ljlevend2" <(E-Mail Removed)> schrieb:
>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!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

 
Reply With Quote
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      14th Feb 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing Custom Shape Using PowerPoint Drawing Tool Mosfiqur Rahman Microsoft Powerpoint 0 6th Jul 2008 01:06 PM
Custom scrollbars? magmike Microsoft Access Forms 0 10th Jan 2008 08:32 PM
Scrollbars on Custom Control gotcode@gmail.com Microsoft Dot NET Framework Forms 1 19th Dec 2006 06:39 PM
Custom Scrollbars =?Utf-8?B?QWx2byB2b24gQ29zc2VsIEk=?= Microsoft C# .NET 0 16th Jul 2005 08:04 AM
Custom control: adding scrollbars Gerben van Loon Microsoft C# .NET 1 23rd Jul 2003 12:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:59 AM.