473,770 Members | 3,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom drawing all scrollbars in application

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

Feb 7 '07 #1
6 7724
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 programmaticall y,
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.

Feb 8 '07 #2
On Feb 7, 6:10 pm, ljlevend2 <ljleve...@nosp am.nospamwrote:
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

Feb 8 '07 #3
Hi Sebastian,

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

Lance

Feb 9 '07 #4
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

Feb 9 '07 #5
"ljlevend2" <lj*******@nosp am.nospamschrie b:
>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/>

Feb 9 '07 #6
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

Feb 14 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
6200
by: Sagaert Johan | last post by:
I have made a custom control that draws a rectangle when the mouse is down, and does nothing when the mouse is up. I set/reset a flag in MouseDown/Mouse up and use this to do the drawing in the OnPaint . The recangle draws correct when i press the mouse, but when i release the mouse the background is not restored What should i do in the Onpaint to make sure the background (the form) is restored correctly ? This problem already keeps...
3
5808
by: Alberto | last post by:
I'm drawing an image in a panel control with this sentence in the Paint method: e.Graphics.DrawImageUnscaled(Image, panelImage.AutoScrollPosition); The problem is that I only want to paint a region of the image specified by a Rectangle object. I can do it with: e.Graphics.DrawImageUnscaled(Imagen, myRectangle);
6
8164
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters for scaling. This can sometimes get rather complex when you need to take scaling into account or other things like window resizing, scrolling, etc. There is a property called PageUnit which can be set to World. I could not find any examples...
4
1829
by: Steve | last post by:
I am fairly new to VB.NET, and I am rewriting an application I wrote a while back, also in VB.NET. I aplied some new things I learned. Anyway, here is my problem....... I have a custom DataGrid with a buttonRow that does a delete function for me. Microsoft support helped me back then to get this done. Here is part of the code that creates the dataGrid: Dim ButtonColStyle As DataGridButtonColumn
2
2446
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just fine. However, when attempting to assing default values as designtime in the propertygrid, nothing is working on the class object. I know that I am doing it wrong, any ideas what it is? Thanks in advance
0
1267
by: Kay | last post by:
Hello, I have developed a web custom control, I want one of the properties of the control to appear as a dropdown list so the user can select from the list. My question is: how do I define an editor to fill up the dropdown list, so far I have the following code which displays the property as a dropdown but I do not know how to get values it to it, I have only 3 values. Public Class EntryModeEditor Inherits...
0
1240
by: Kay | last post by:
Hello, I have developed a web custom control, I want one of the properties of the control to appear as a dropdown list so the user can select from the list. My question is: how do I define an editor to fill up the dropdown list, so far I have the following code which displays the property as a dropdown but I do not know how to get values it to it, I have only 3 values. Public Class EntryModeEditor Inherits...
0
1120
by: neo | last post by:
I am working on vs2k5. I made MFC-SDI application and view class inherited from CListView. I was tried a lot to bold one row in List using custom drawing but I was able not understand, how to use custom drawing. I was changed text color of one row using custom drawing, and following code written for NM_CUSTOMDRAW message void CTestView::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult) {
7
3561
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the excellent transforms specified on Bob Powell's site, I still wonder if there's an easier way of centering it than the following procedure? Here is what I do now (it's awkward but it works): 1) I follow the transforms specified on Bob Powell's...
0
9595
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.