Colored Scroll bars

Hi,
We would like to change background color of all scroll bar components in our
..Net application, but change should apply to all controls in our
application. I mean not only ScrollBar controls explicitly used, but scroll
bars in tree, listview, combo and third-party controls etc. We even have MFC
control used through managed c++ wrapper with its own scroll bars.
Is there some way to do it (subclassing windows, application-wide hook, etc)
?
We can code it Win32 pure if it helps.

Alexander Arlievsky.


0
11/3/2003 9:44:32 AM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
1605 Views

Similar Articles

[PageSpeed] 17

Scroll bars in list controls, tree controls, etc. are not "real" scroll bars, but are just
images painted on the background of the control. Consequently, there are no
WM_CTLCOLOR_SCROLLBAR messages generated for those controls. I am not aware of any simple
way to accomplish this.
				joe


On Mon, 3 Nov 2003 11:44:32 +0200, "Alexander Arlievsky"
<alex_ReMoVe_@mprest.remove.com.spam> wrote:

>Hi,
>We would like to change background color of all scroll bar components in our
>.Net application, but change should apply to all controls in our
>application. I mean not only ScrollBar controls explicitly used, but scroll
>bars in tree, listview, combo and third-party controls etc. We even have MFC
>control used through managed c++ wrapper with its own scroll bars.
>Is there some way to do it (subclassing windows, application-wide hook, etc)
>?
>We can code it Win32 pure if it helps.
>
>Alexander Arlievsky.
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
11/3/2003 6:06:37 PM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:966dqv8g5aobmrqnbnfa7arrs1jtdn657e@4ax.com...
> Scroll bars in list controls, tree controls, etc. are not "real" scroll
bars, but are just
> images painted on the background of the control. Consequently, there are
no
> WM_CTLCOLOR_SCROLLBAR messages generated for those controls. I am not
aware of any simple
> way to accomplish this.
> joe
>
This exactly why I sent this question - I know how to handle CTLCOLOR stuff.

Anyone else ? :)
Alexander Arlievsky.

>
> On Mon, 3 Nov 2003 11:44:32 +0200, "Alexander Arlievsky"
> <alex_ReMoVe_@mprest.remove.com.spam> wrote:
>
> >Hi,
> >We would like to change background color of all scroll bar components in
our
> >.Net application, but change should apply to all controls in our
> >application. I mean not only ScrollBar controls explicitly used, but
scroll
> >bars in tree, listview, combo and third-party controls etc. We even have
MFC
> >control used through managed c++ wrapper with its own scroll bars.
> >Is there some way to do it (subclassing windows, application-wide hook,
etc)
> >?
> >We can code it Win32 pure if it helps.
> >
> >Alexander Arlievsky.
> >
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
11/4/2003 1:27:44 PM
> > Scroll bars in list controls, tree controls, etc. are not "real" scroll
> bars, but are just
> > images painted on the background of the control. Consequently, there are
> no
> > WM_CTLCOLOR_SCROLLBAR messages generated for those controls. I am not
> aware of any simple
> > way to accomplish this.
> > joe
> >
> This exactly why I sent this question - I know how to handle CTLCOLOR
stuff.
>

as Joe said there is no simple way...:(
but i have founded workaround...

you have to disable scrolling in your control, next you can use CWnd
deriaved class for painting scrollbar.
next step is to attach you control to you scrollbar....
this will take a lot of work, but unfortunatelly i don't know other way.

Regards, Robert


0
sftech1 (45)
11/4/2003 3:18:22 PM
This article describes "skinning" of a list control, including its
horizontal and vertical scroll bars.

http://www.codeproject.com/listctrl/skinlist.asp

Looks complicated, and pixel-counting intensive.


"Alexander Arlievsky" <alex_ReMoVe_@mprest.remove.com.spam> wrote in message
news:%23xKbQ7eoDHA.1488@TK2MSFTNGP12.phx.gbl...
> Hi,
> We would like to change background color of all scroll bar components in
our
> .Net application, but change should apply to all controls in our
> application. I mean not only ScrollBar controls explicitly used, but
scroll
> bars in tree, listview, combo and third-party controls etc. We even have
MFC
> control used through managed c++ wrapper with its own scroll bars.
> Is there some way to do it (subclassing windows, application-wide hook,
etc)
> ?
> We can code it Win32 pure if it helps.
>
> Alexander Arlievsky.
>
>


0
11/4/2003 5:30:46 PM
As another approach (not tried), maybe you could create the controls with
the "Custom Draw" style (e.g., LVS_CUSTOMDRAW for list controls) and
intercept the NM_CUSTOMDRAW notification at the CDDS_POSTPAINT stage.  From
there, the control would have already painted its scroll bar, which you
could over-draw by plastering up your own bitmap of a scroll bar wherever
it's needed.  See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/custdraw/custdraw.asp


"Michael K. O'Neill" <MikeAThon2000@nospam-hotmail.com> wrote in message
news:O5gC4lvoDHA.1284@TK2MSFTNGP09.phx.gbl...
> This article describes "skinning" of a list control, including its
> horizontal and vertical scroll bars.
>
> http://www.codeproject.com/listctrl/skinlist.asp
>
> Looks complicated, and pixel-counting intensive.
>
>
> "Alexander Arlievsky" <alex_ReMoVe_@mprest.remove.com.spam> wrote in
message
> news:%23xKbQ7eoDHA.1488@TK2MSFTNGP12.phx.gbl...
> > Hi,
> > We would like to change background color of all scroll bar components in
> our
> > .Net application, but change should apply to all controls in our
> > application. I mean not only ScrollBar controls explicitly used, but
> scroll
> > bars in tree, listview, combo and third-party controls etc. We even have
> MFC
> > control used through managed c++ wrapper with its own scroll bars.
> > Is there some way to do it (subclassing windows, application-wide hook,
> etc)
> > ?
> > We can code it Win32 pure if it helps.
> >
> > Alexander Arlievsky.
> >
> >
>
>


0
11/4/2003 5:59:43 PM
This is what MSDN (Platform SDK\User Interface Services\Controls Scroll
Bars\...) says on the subject
WM_CTLCOLORSCROLLBAR
The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll
bar control when the control is about to be drawn. By responding to this
message, the parent window can use the display context handle to set the
background color of the scroll bar control.

<...>

"Alexander Arlievsky" <alex_ReMoVe_@mprest.remove.com.spam> wrote in message
news:%23xKbQ7eoDHA.1488@TK2MSFTNGP12.phx.gbl...

> Hi,
> We would like to change background color of all scroll bar components in
our
> .Net application, but change should apply to all controls in our
> application. I mean not only ScrollBar controls explicitly used, but
scroll
> bars in tree, listview, combo and third-party controls etc. We even have
MFC
> control used through managed c++ wrapper with its own scroll bars.
> Is there some way to do it (subclassing windows, application-wide hook,
etc)
> ?
> We can code it Win32 pure if it helps.
>
> Alexander Arlievsky.
>
>


0
11/10/2003 2:49:02 PM
Reply:

Similar Artilces:

How do I locate the send on the menu bar?
I am using Microsoft 2000, and the send, to expedite my email message does not show on the menu bar. Any suggestions on how I may locate it. "Newlearner" <Newlearner@discussions.microsoft.com> wrote in message news:A80EFCD9-3BCA-4BD2-AD47-A1699A9C2164@microsoft.com... >I am using Microsoft 2000, and the send, to expedite my email message does > not show on the menu bar. Any suggestions on how I may locate it. It's already in the File menu. For the Database toolbar: With any database window open, right-click on the toolbar, and choose Customize. Select File in th...

Change background / color of chart worksheet?
Need steps to change the color or backgound of the worksheet that is a chart. Have multiple tabs in workbook that are just the charts. Only option for background is to use Format-Sheet-Background. That changes background of chart, but not the grey areas around the chart on the chart tab. You need to select the Chart Area (what you call the, "grey areas around the chart") and format that. There are 2 separate, "parts" to a chart:- 1. The Plot Area (which you seem to have formatted OK) and the 2. Chart Area. You need to select each of them to format th...

annoying scrolling
I've got an annoyance when using Excel. Sometimes when I attempt to select a series or rows that extend beyond the size of the screen, my machine will scroll so fast when I reach the end of the viewed area that it goes well beyond where I want it to stop. Is there a simple way to deal with this? Russ Start at the bottom and work your way up. Click on the topleft cell and use the scrollbars to go to the bottom left corner and shift click on that. Find out the address and (A2:B999) and type that into the address bar. Russ wrote: > > I've got an annoyance when using Excel. ...

Menu Bar will NOT disable
Hi all, I am trying to disable the menu bar at runtime/startup. I have researched this site and used the solutions presented such as, application.commandBars ("menu bar").enabled = False (tried = 0, too!) and code options. Placed the code in the form_Open and form_load events. I haven't had any success? I have unchecked all setting in the Tools --> Startup and the Tools --> Options that deal with toolbars and shortcut menus, this was not successful, too. I am at a loss. Can anyone direct me what to do next? This site is VERY helpful I use it as a reference all t...

Color Break in Line Charts?
I have a cash projection spreadsheet with a linked line chart. In the projection sheet, the font goes from black to green when the data goes from actual to projected. Is there a way to make the line or the x-axis change colors at the point that the date does so (i.e., have the line turn green halfway through the chart)? Thank you in advance. On Oct 23, 8:39=A0am, Mr. Platypus <MrPlaty...@discussions.microsoft.com> wrote: > I have a cash projection spreadsheet with a linked line chart. =A0In the > projection sheet, the font goes from black to green when the data goes fr= om...

CRM Views should have easier scrolling
When adding or modifying a CRM view by adding columns, you may have to scroll left/right to see view contents. Then you may have to scroll up/down. However, you can't see up/down scroll bar and column one contents at the same time. This needs a fix. your totally right. Right now the only way to keep this becoming an issue is to not add too many fields so the vertical scroll bar dissapears. The only solution I can see would be to have a vertical scroll bar on both sides of the view. -- John O'Donnell Microsoft CRM MVP http://www.mscrmfaq.us "Larry" <Larry@dis...

How do you control the color/pattern of a pie chart?
I need help with my pie charts. I need to create pie charts that are easily understood in B&W. How do I set the color or pattern for each portion of my pie chart? Hi, To format a slice you need to select it first. Click the pie once to select all slices. Click again to select individual slice. You can use the Fill Effects > Patterns to fill with b/w patterns. Also in print preview the Setup dialog has a Print Black & White option on the Chart Tab. Note this is only visible if you have a chart sheet or select the chartobject before print preview. If you are printing chartobje...

Bar Chart #6
Hi All I have a bar chart with different percentages displayed as the columns. Or target is 70%. Is it possible to have a target line added to the bar chart to show how many meet the target? In a line graph I just add a target column to create the target line but this will not work with a bar chart Any help greatly appreciated Kind regards Rexmann opps forgot to say using Excel 2003 "rexmann" wrote: > Hi All > > I have a bar chart with different percentages displayed as the columns. Or > target is 70%. Is it possible to have a target line added to the bar cha...

Side by side stacked bar chart
Is it possible to do a chart that has side by side stacked bars for different periods? For example, I want to compare quarterly profits for the years 2004 and 2005. I am using MS Excel 2003. Hi, See Jon Peltier's page on cluster stacked column chart. http://peltiertech.com/Excel/ChartsHowTo/ClusterStack.html Cheers Andy JRW523 wrote: > Is it possible to do a chart that has side by side stacked bars for different > periods? For example, I want to compare quarterly profits for the years 2004 > and 2005. I am using MS Excel 2003. -- Andy Pope, Microsoft MVP - Excel http://...

delete rows when any cells in column A is filled in RED color
Hi people, I need your help for a VB code that can delete the rows with any cells in column A being filled in RED color ? Alternatively, it will be fine for me if you have the code that can move the rows to the top when there are cells being filled in RED color in column A . Thanks in advance for help. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements If the colors are ...

Set the color of grid depend on variable
I'd like to set the color of cells (sheet1) [A1...A8] -> Red [A9...A28] -> Green [A29...A44] -> Blue [A45...A54] -> Red .... based on data from sheet2 Start Stop Color 1 8 Red 9 28 Green 29 44 Blue 45 54 Red ..... How to do it ? -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Radoslaw Krzyzan , pl.communicator@radek http://www.communicator.pl , ICQ 4336523 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hi for only three colors have a look at 'format - conditional Format'. For more than 3 conditions you need VBA -- ...

::: More than 8 seconds on space bar = Cursor blocked ! Please HELP !
Hello, I press more than 8 seconds on the space bar. Now my cursor is blocked. Like if I wanted to select many cells. How can I go back to a normal situation ? And free my cursor! Many thanks in advance for your help. Jacques try touching the f8 key -- Don Guillett SalesAid Software dguillett1@austin.rr.com <infojacques@gmail.com> wrote in message news:1178563983.482171.224070@p77g2000hsh.googlegroups.com... > Hello, > > I press more than 8 seconds on the space bar. Now my cursor is > blocked. Like if I wanted to select many cells. > > How can I go back to a no...

Turning a row color to "yellow" if one date field is greater than another.
I would like to automatically turn a row color to yellow if the current date is greater than a "needed by" date column. What is the best way to do this? Hi Select the rows necessary and then go to Format/Conditional Formatting. If your 'needed by' date is in column D use 'Formula Is' and then in the box type: =$D1=today() Hope this helps. Andy. "Ray Stevens" <nfr@nospam.com> wrote in message news:umTvfnURGHA.4976@TK2MSFTNGP11.phx.gbl... >I would like to automatically turn a row color to yellow if the current >date is greater than a &q...

incident navigation bar
hi, I can hide the left navigation bar items in the incident form. But the white space of navigation area is still there. Is there a way to remove this white space? ...

To ignore scrolling CListCtrl using mouse.
I want to ignore mouse control on a scroll bar of CListCtrl. I ignored WM_VSCROLL, WM_MOUSEMOVE, and WM_MOUSEWHEEL messages on PreTranslateMessage of CListCtrl derived class. But it still works. How to ignore scrolling? I don't want to remove the scroll bar. ...

CRM 4
Using the IFrame we have displayed the Contacts list for an account in account frame... Now the issue is we have to hide the "Activity Bar" (i.e. top menu with the menus like "New Contact", "Add Existing Contact", blah blah...)... We tried adding below code in onload event without any success. Tried lot of combinations but it does not works... if(crmForm.FormType != 1) { if (document.all.IFRAME_Contacts != null) { document.all.IFRAME_Contacts.src = "/sfa/accts/areas.aspx?oId=" + crmForm.ObjectId + "&oType=1&security=852023&tabS...

Scatter and bar
Hi I have posted a screen shot of my chart here - http://xs.to/xs.php?h=xs35&d=05260&f=chart.jpg I would like to know if it is possible with the chart to change the turquoise line named Digester feed mean % DS to work with the scatter chart using the secondary axis already in place as a bar mixed scatter chart? I really appreciate your comments i think the chart would look great like this. Many Thanks Rob - p.s if the image doesnt load right click and choose show picture then it should load. Select the series that you want to change to a bar chart. Right click and choos...

New HP Color LaserJet
Our company is looking to purchase a new HP Color LaserJet for use with Dynamics GP 9.0 and later (when they are released). However, the GP compatibility list does not include any current model HP color laserjets. This will be a workgroup printer and color is necessary. I would like to stick with HP's since we have had good luck with them in the past. I was looking at maybe the 4700dn, 3800dn, or the 3600dn. Has anyone been using any of these models? Alan, We don't have anyone using the models you listed, we do have one customer using the HP 2840 Color LaserJet with no pro...

Using VBA coding to count color Occurrences
Hi: I am using Office (Word, Excel, and Powerpoint) 2007, and Windows 7, and below is what I'm trying to accomplish, hopefully, with VBA coding: In Columns L & M I have dates that identify a beginning and end date for a class (L is "beginning" date and M is "end date") that a student has signed up for. If the student has not paid for their class, the class dates in Columns L & M are in "bold red font". Once payment has been made, the font changes from "bold red" to "unbold black" thanks to conditional formatting. ...

Bar code on bulk mail labels
The POSTNET bar code that Microsoft Word generates no longer qualifies for USPS bulk mailing discounts. Further, the bar code appears above the address and the USPS now wants it below. Does anyone know how to fix this? Hi Steve, I find it unusual that there has not been a big fuss over the bar code no longer qualifying for bulk mailing discounts. Do you have a link or something that points to this information? It's not a big deal to put the bar code at the bottom of the address instead of the top. Just add it last (put in a carriage return first) as you build the address in the Data M...

missing the menu bar
Office 2000 - Excel on a XP machine. The program runs fine but I have no menu bar. Tool bar exists. Someone must have change something but I don't know what. How can I restore the menu bar (File, Edit, View....) Thanks, Uzi 11-30-05 You are able to move the menu bar around.It's not sitting at the bottom, left or right of the screen? -- Greetings from New Zealand Bill K "uzidengineer" <uzib97@yahoo.com> wrote in message news:1133375416.725387.262880@g47g2000cwa.googlegroups.com... > Office 2000 - Excel on a XP machine. > The program runs fine but I have no m...

How can I apply a CMYK color to a chart?
We use corporate colors to our bar charts. I usually copy and paste the chart into Illustrator and then edit separately each part of the chart. But, is there a way to apply directly on the Excell a cmyk color or a pantone? When I copy and paste a chart on Illustrator I have undesirable copies of lines. Can this be avoided? XL supports a palette limited to 56 colors. It is possible to substitute a color of your choice for one of those through Tools | Options... | Color tab | select an existing color, click the Modify... button and in the resulting Color dialog box click the Custom tab...

How to change the color of all series in an excel chart in one go.
In Excel 2000 I have a chart (XY) with a large number of series. Excel assigned different colours to each series. I would like to have the same color for all series and then change a few to highlight them. Do I have to change them all one by one or can I have excel make a chart where the series all have the same color (preferably chosen by me)? Marielle, Perhaps you can use VBA to automate the line coloring and then use a custom chart as a default for your new charts . . . This macro will return the series color index for series number 1. If you don’t know the color index for the ser...

how can I have no overlap bars when using axis2?
how can I have no overlap bars when using the secon axis? Hi, Have a look at Jon's example. http://peltiertech.com/Excel/Charts/ColumnsOnTwoAxes.html Cheers Andy Fernando wrote: > how can I have no overlap bars when using the secon axis? -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info ...

After closing, Outlook remains in task bar, How did get rid of it
I have 4 profiles on my outlook. two weeks ago, whenever the first person logged on after a shutdown, an icon appears in the task bar. When outlook is subsequently closed, the icon remains. Any further attempt to open outlook, opens to the profile that was last opened. It should open to a window that allows a different profile to open outlook. Now the only way to switch profiles is to shutdown and reopen outlook. That profile is then the only one that can be opened until shutdown. Can anyone help!! You have a 3rd party application installed that is keeping Outlook open at ...