Color output to ListBox windows

A simple question with a very low likelihood of an affirmative answer:

Can data output be done in color to the list box window ?

Thank you,
Andrew.


0
Utf
6/15/2004 4:28:02 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
320 Views

Similar Articles

[PageSpeed] 46

"Andrew K." <Andrew K.@discussions.microsoft.com> wrote in message
news:67BD3632-E897-4555-8B41-D93991912DD2@microsoft.com...
> A simple question with a very low likelihood of an affirmative answer:
>
> Can data output be done in color to the list box window ?

Yes. Use WM_CTLCOLORLISTBOX or ownerdraw it depending on your needs.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
6/15/2004 4:41:44 PM

"Jeff Partch" wrote:

> "Andrew K." <Andrew K.@discussions.microsoft.com> wrote in message
> news:67BD3632-E897-4555-8B41-D93991912DD2@microsoft.com...
> > A simple question with a very low likelihood of an affirmative answer:
> >
> > Can data output be done in color to the list box window ?
> 
> Yes. Use WM_CTLCOLORLISTBOX or ownerdraw it depending on your needs.
> -- 
> Jeff Partch [VC++ MVP]
> 
> 

Thank you Jeff,
As always, you are of a great help !

I wonder now if the list box attributes (in this case, a color of the LB items) could be changed dynamically. In other words, I want to populate the list box with entries that would have different colors depending on what they describe or refer to. Can this be done fairly easily or this implies a lot of unjustified overhead ?

Many thanks,
Andrew

0
andrewk1 (24)
6/18/2004 8:31:02 PM
Andrew K. wrote:
>>>Can data output be done in color to the list box window ?
>>
>>Yes. Use WM_CTLCOLORLISTBOX or ownerdraw it depending on your needs.
>>-- 
>>Jeff Partch [VC++ MVP]
>>
> Thank you Jeff,
> As always, you are of a great help !
> 
> I wonder now if the list box attributes (in this case, a color of the LB items) could be changed dynamically. In other words, I want to populate the list box with entries that would have different colors depending on what they describe or refer to. Can this be done fairly easily or this implies a lot of unjustified overhead ?
> 
> Many thanks,
> Andrew
> 

The ownerdraw option will let you color each list item individually, and 
  any other effects you care to draw.  It is a bit of work to learn 
because you have to do the item painting yourself, including details 
like item highlighting and focus.  But a very worthwhile effort: Many 
apparently-custom controls are built this way.  The CTRLTEST MFC sample 
has a multicolored owner-drawn list box that can get you started.

-- 
Scott McPhillips [VC++ MVP]

0
scottmcp8856 (490)
6/18/2004 11:36:08 PM
> > 
> 
> The ownerdraw option will let you color each list item individually, and 
>   any other effects you care to draw.  It is a bit of work to learn 
> because you have to do the item painting yourself, including details 
> like item highlighting and focus.  But a very worthwhile effort: Many 
> apparently-custom controls are built this way.  The CTRLTEST MFC sample 
> has a multicolored owner-drawn list box that can get you started.
> 
> -- 
> Scott McPhillips [VC++ MVP]
> 

Thank you so much Scott ! I'll definitely give it a try.

All the best,
Andrew

0
andrewk1 (24)
6/19/2004 3:32:01 AM
Reply:

Similar Artilces:

Font Colors
is there any way to add additional color options for the Fonts in Outlook 2003? Windows XP Are you using word or the outlook editor? Choose Font Color, More Colors to open the color picker - you can make any color supported by your version of windows. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM...

custom colors in dialogbars
hi, Is it possible to customize the colors in a dialogbar, something like OnCtlColor in dialogs ? Thanks, Behzad I've never used CDialogBar for some time, but it seems to me that a control is a control so OnCtrlColor should probably still work if you implement the handler. Dialog bars just have controls. Tom "Behzad" <b@y.c> wrote in message news:ektaRAVCHHA.4992@TK2MSFTNGP03.phx.gbl... > hi, > Is it possible to customize the colors in a dialogbar, something like > OnCtlColor in dialogs ? > > Thanks, > Behzad > I used OnCtlColor to...

All charts in gray color
In SharePoint Sever after I upload a excel file all my charts are displayed in single gray color, not even a different tones of gray just one tone, any idea how to correct that behavior? Thanks in advance ...

Paper output size question
Hi, I'm trying to set up a continuous feed printing system using an Okidata 9 pin printer on an XP system with Excel 2003. The paper is an odd size. Between the tractor pins it is 9 inches, between vert perfs its 8 3/8 inches. But its only 4 and a quarter inches between horizontal perfs. After you tear off the edges, etc., you wind up with a rectangular piece of paper 4 1/4 long by 8 3/8 wide. (which is exactly what I want) The problem is when I go to page setup, I can't find a place to tell it the paper size. It has 5 pre-defined paper sizes, 8 1/2 by 11, A 5, A4, B5, ...

Why does IE always open minimized windows when opening a new window?
When I minimize a window, to refer to later, and then open another window, the minimized window opens to full screen for a few seconds before the new window appears. Why can't IE not open a new window without maximizing some other window at the same time? Is there a solution to this problem? Kathy -- scrimaglia Posted via http://www.vistaheads.com scrimaglia wrote: > When I minimize a window, to refer to later, and then open another > window, the minimized window opens to full screen for a few seconds > before the new window appears. Why can't IE not ...

Windows Time Causing Exchange Crash
I am running Exchange server 2003 sp2 on windows 2003 sp1 with two domain controllers running 2003 as well. The problem is exchange will periodically quick working, I get a windows system event saying it cannot do an LDAP bind with either of the DCs when I restart windows time service on the DCs email starts going again. Time is in the right Time zones and set correctly on all servers. Any suggestions? Thanks Can we see complete unedited event from event log? What happens after you get that event? jspr wrote: > I am running Exchange server 2003 sp2 on windows 2003 sp1 with two >...

Windows too large
System specs: Vista Business Intel Core2Duocpu t5470 NVIDIA GeForce 8400M GS I was having problems seeing the fonts inside the windows and the icons on the desk top. I customized the DPI to 144. This made the widows too large. When I went back to the DPI page to change back to 96 DPI, I couldn't reach the buttons on the bottom of the page to apply the change. The other problem is that the task bar is too large. It covers the bottom of the page. Again, I can't change it because I can't reach the apply buttons on the bottom of the page. I need to make the changes bec...

Coexsistence GroupWise 6.5 and Windows 2003
I have done couple of these migrations from Groupwise 5x to windows 2000 or 2k3. Now I researching on a up and coming project to do migration from 6.5 to 2k3. There seems to be an issue GroupWise API is old technology and seems it is not supported. Let me rephrase that you cannot create it using ConsoleOne and maybe i can getway with using the older Snapins say from GW 5.5 for NWAdmin. I see the utility by Novell Gateway for Exchange, has anyone used that for migration? any issues ? do you recommend using that? Or I am wrong into thinking that is a solution? Is there something develo...

Is tooltip window
Hi all, I am having an HWND, using this how can i able to get whether it is a tool tip window ? thanks in advance. Regards, Umesh P <kbnumesh@gmail.com> wrote in message news:1176702297.777421.285420@d57g2000hsg.googlegroups.com... > Hi all, > > I am having an HWND, using this how can i able to get whether it is > a tool tip window ? > Call GetClassName() and compare it to the tooltip class name (whatever that is). -- David ...

Chart line colors
Hi I create a few charts in code from VB.NET using the excel interops, office 2003. In my software I need to be able to set the color of the lines i.e. the color of each series on the chart. There may be up to 9 series per chart. How do I asign a color to the series lines on the chart? Thanks Pieter Get out your version of Excel, make a chart like the one your code will produce, then record a VBA macro while you change the series formats manually. Then all that's left is to translate the VBA into VB.Net. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solut...

Chart background color not copying along
Hi, I have a problem with charts that are placed on seperate chartsheets within my workbook. The chart-area is filled in different of yellow with a fill-effect. No problems thus far. But now when I'm copying the chart to word, the background-fill is reset to a black/white scheme instead of yellow. Strange behaviour that didn't occur up till november 2008. I've been researching this for a while. Up till now I found the following: This only happens when the chart is on a seperate sheet, not when it is positioned on a worksheet. It only happens with fill-effects. The color-swit...

IE 8 secondary window problem?
Hi, Not sure this is the right place to post this question; if not I'd appreciate a link as to where to do it. Problem (if it is a problem, well, for me it is a problem!) is that when I'm on a page in IE 8 and click on something that opens in a second window (like a news article), the second window is about 1/3 the size of the full window. I have to enlarge it to see the whole article, video, or whatever. This gets a bit repetitive, and I'd rather have the second window open to full size but can't figure out if there's a setting to control it, and if so, which ...

Windows is not currently managing your wireless network
We have two computers in the house, one connected by wire to the router, and one via wireless. Of course they were set up by our kids.... Today I had to unplug all the wires and plug them back in again. Since that time the wireless computer hasn't been able to connect. In START/Connected to/Wireless connections we see the connection we expected. Status - Connected Network - Hunt's Corner Signal Strength - 5 bars When I go to the providers speedtest website we have excellent speed. That all looks good, But if I click the "View Wireless Networks" b...

cross administrative group move windows 98
We recently installed exchange 2003 in our organisation. We are now running in mixed mode with exchange 5.5. We are not able to do a cross administrative group move for mailbox of all windows 98 users. (from exchange 5.5 to exchange 2003). Any idea? Eric Lajeunesse <eric.lajeunesse@saputo.com> wrote: > We recently installed exchange 2003 in our organisation. We are now > running in mixed mode with exchange 5.5. > We are not able to do a cross administrative group move for mailbox > of all windows 98 users. (from exchange 5.5 to exchange 2003). > Any idea? Ask in th...

Add Value of Cells by Color
How do I sum the values of cells with a specific color?? Hi see: http://www.cpearson.com/excel/colors.htm -- Regards Frank Kabel Frankfurt, Germany B2 wrote: > How do I sum the values of cells with a specific color?? ...

where is pick color option to fill autoshape color
i was using office 2010 technical preview, there was an option to pick color from other object /picture to fill autoshape/textbox, but now i try office 2010 beta 14.0.4536.1000: the option no longer exist, why remove it ? i think its useful ...

Answer to the most annoying problem of Windows 7
This message was posted here because: 1. I couldn't find any newsgroup on Microsoft Communities for Windows 7 (which I believe is an absolute must) 2. the program mentioned at the end would also work for Vista. From day one of upgrading to Windows 7, I was faced with the unpleasant reality that Win7 doesn't remember the size and position of folders. To further torture me, for some reason unknown to me, it began to restrict some programs' windows--such as IE , Outlook, Chrome, and a few other--to a fixed size and position, not allowing any change no matter how many times...

Finding all instances of an ink color
I am ordering printing inks for my company. I am trying to set up a form that will lookup all the same colors. For instance we might have 4 different 185C red inks for different substrates and each of the colors could come from different vendors. This would give me up to 12 different 185C reds on my ink list. What I would like is a form that would pull up each of the 12 different 185C's and its related info. (Formula number, vendor, and price). I have tried vlookup but it only finds the first instance of 185C red. Does anyone have any other ideas?? Thanks in advance. -- ldd ----------...

Windows Event Log Reader (not server based)
Fist, I already know about "Log Parser" and all the sever-based Event Log utilities. What I would like is a simple GUI utility to read/view SAVED Event Log files. Anyone know of such a utility (non-server)? NOTE: I do have a shortcut in my "SendTo" folder that runs a Command using "Log Parser" but this is a workaround. Command start-------------- cd \EventLogArchive "C:\Program Files\Log Parser 2.2\logparser" "SELECT ALL * FROM %1" - i:EVT -o:DATAGRID Command ends-------------- "\EventLogArchive" = C:...

Windows Messenger fails to load
I know most of you think that Windows Messenger loading with Outlook Express is a curse, but I think its rather neat. However, when I installed AOL's Messenger, I accidentally set it to be the default messenger. This caused AOL messenger to load up instead of Window's Messenger when I open OE. However, i set default back to Windows Messenger (through addremove progs, set defaults). But when i get to Outlook Express, when i go to Tools > Windows Messenger > send instant message i get the following error: "Internet Explorer Install on Demand failed to install Windo...

pop up window and sound on deleting a message
How can I stop the pop up the window and sound when you delete a message in windows mail?? It wasn't doing it yesterday when I synchronised email address' with windows mail ... It is a problem as if you receive a lot of messages there are a lot that you have to delete and I do not get this on gmail or hotmail .... another question is: I don't get a popup or sound when I delete messages. Exactly how are you deleting the messages? Are you deleting from the Inbox? --=20 Gary VanderMolen, Microsoft MVP (Mail) Microsoft MVP program: http://mvp.support.microsoft.com...

font color #2
Hi, I have a large spreadsheet which to make easier to search visually I have colored the font according to the action required. Manually changing the font color for each cell is a bore. Can i indicate at the begining of the row what color i want in each cell in that row? Darrian Can you not use the 'format painter'? It's the paint brush icon on the toolbar. Tip: Double clicking it, when on a cell with capture the format and not 'release' it until you click the button again, whereas a single click only gives you a single operation -- HTH Nick Hodge Microsoft MVP ...

Help on parallel port programming under Windows XP
Dear all, I have a problem in programming to read a pin from the parallel port under Win XP. Anyone got any sample code to help me? Best regards, Choon Beng Phee Choon Beng wrote: > Dear all, > > I have a problem in programming to read a pin from the parallel port under > Win XP. Anyone got any sample code to help me? > > Best regards, > > Choon Beng > > Application programs cannot read/write I/O ports in NT/2K/XP, only device drivers can. If your needs are simple you can find free drivers that will let you do this at http://www.lvr.com/parport.htm ...

Opening new calendar or contact window maximized (without Navigation Pane?)
I struggled for a long time to figure out how to open a new Calendar, Task, or Contact window with the window maximized AND without the Navigation Pane. I typically keep my main Outlook window set to show my Inbox along with the Navigation Pane so I can see my mail folders. Then if I want to see my calendar, I right-click on the "Calendar" button in the Navigation Pane and select "Open in New Window". However, this can be frustrating if the default window size is not set correctly and you don't need the Navigation Pane in any new window. The way to solve the size issue...

Visible region of a window
The method CWnd::IsWindowVisible() return trues when WS_VISIBLE flag is set to true. "the return value may be nonzero even though CWnd is totally obscured by other windows." Is it possible to find out whether my window is actually obscured by another window even when IsWindowVisible() returns true? Thanks ...