Background colour in CListCtrl

I am using a CListrCtrl in report style and  I want to set the background 
colour of an individual cell to be red or green.

Although I can set the background colour for every cell I cant do it for an 
induvidual one.

Can anyone help?

thanks in advance

Chris


0
ChrisBaker (163)
10/25/2004 1:07:07 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
401 Views

Similar Articles

[PageSpeed] 6

Look into owner draw listbox.

AliR.

"Chris Baker" <ChrisBaker@discussions.microsoft.com> wrote in message
news:9E7F010D-95B5-42A2-9834-4C81A9034A3C@microsoft.com...
> I am using a CListrCtrl in report style and  I want to set the background
> colour of an individual cell to be red or green.
>
> Although I can set the background colour for every cell I cant do it for
an
> induvidual one.
>
> Can anyone help?
>
> thanks in advance
>
> Chris
>
>


0
AliR (178)
10/25/2004 3:42:53 PM
Or better yet custom draw.

"AliR" <AliR@mailserver.com> wrote in message
news:1a9fd.629$bP2.99@newssvr12.news.prodigy.com...
> Look into owner draw listbox.
>
> AliR.
>
> "Chris Baker" <ChrisBaker@discussions.microsoft.com> wrote in message
> news:9E7F010D-95B5-42A2-9834-4C81A9034A3C@microsoft.com...
> > I am using a CListrCtrl in report style and  I want to set the
background
> > colour of an individual cell to be red or green.
> >
> > Although I can set the background colour for every cell I cant do it for
> an
> > induvidual one.
> >
> > Can anyone help?
> >
> > thanks in advance
> >
> > Chris
> >
> >
>
>


0
not1 (120)
10/25/2004 5:01:31 PM
Reply:

Similar Artilces:

Background Sizing
I am creating an ad in Publisher and I specify the size on the ad on page set up. Everything is fine until I add a background - the ad is then larger than the settings I entered. Backgrounds want to cover the entire page with a little left over. What size is your ad? What happens if you create an autoshape and fill it? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Jen B" <Jen B@discussions.microsoft.com> wrote in message news:2F093E5C-B689-46DF-BC97-01FD15A2235D@microsoft.com... >I am creating an ad in Publi...

Display random background pics on form loading?
That's a new one to me... I was asked to do this... I put the pics in one directory, tried to mess with On_Load event, Form.picture = "Path", but nothing (do I need UNC path?)... any help with this? "Maarkr" wrote: > That's a new one to me... I was asked to do this... I put the pics in one > directory, tried to mess with On_Load event, Form.picture = "Path", but > nothing (do I need UNC path?)... any help with this? Figured this out... What I did was this... made a table (PicTable) with 2 fields (PicID, PicPath) and put the paths in the pi...

SHGetFIleInfo: shell icon list for CListCtrl icons
THis sample is should get the default icon for the ".zip" extension then use it in a list control. When executed, the target contol shows the text item ("virtual.zip"), but no image. SHFILEINFO sfi; HIMAGELIST hil; ZeroMemory(&sfi,sizeof(sfi)); hil = (HIMAGELIST)SHGetFileInfo(".zip", FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_USEFILEATTRIBUTES|SHGFI_ICON); // hil now contains the handle to the system image list // containing the large icon images. /...

Add background music????
How do I add background music to a email. I want it to play a song when the receiving person opens the email I sent to them. Thanks Doug Answered in the general newsgroup. Do NOT multipost! -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of the month: -Create your own fully customized Toolbar -Creating a Classic View in Outlook 2003 Subscribe to the newsletter to receive news and tips & tricks in your mailbox! www.sparnaaij.net (I changed my reply address; remove all CAPS and _underscores_...

How to change the row height of CListCtrl?
Dear all, Is there any method to change the row height of CListCtrl? I've looked into the ListCtrl style LVS_OWNERDRAWFIXED, through which I can get message WM_MESUREITEM from the control and then change the row height. But it is for all Items! How can I set a CListCtrl's items with different row height? Or how can I implement the behaviour of LBS_OWNERDRAWVARIABLE style CListBoxCtrl in CListCtrl? Rgds, Marco ...

background color for dashed line
Hi, I'm calling CPen::CreatePen() and passing PS_DASH (white color). My background is black BUT the line I draw (using the CPen object) is drawn on an existing WHITE line. As a result, I cannot see the new dashed line (because it doesn't draw anything between the small lines so I see only one solid line). I know that I can draw two lines- one black and one dashed white, but the question is if I can draw only one dashed line so that between the white small lines it will draw black lines? Regards, Ram. Ram, If memory serves, the color set in SetBkColor will be used by the background...

How can I add more background colors or stationary to Outlook temp
How can I add more background colors, stationery, animated watermarks, etc. to Outlood email? I go to Outlook> Actions> New Mail Message Using > More Stationery but there are only a templates as options. I would like to add templates. For example green for St Paddys, bunny backgrounds, animated (moving) hearts, etc. Thank you Create pages in an HTML editor and save to %appdata%\microsoft\stationery -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by ...

Colour a row, based on a cell value
Hi folks. I have a spreadsheet that contains text, values and dates between columns 'B' and 'I'. What I'd like to do is have formatting set somewhere, so that if the value in the date column is more than two weeks older than the date the file is opened, it should colour the text from column 'B' to 'I' on the row red. If the date is between 1 and 2 weeks in the past, it should colour the text orange. If it is within 7 days old, it should colour it green. If the date field is blank, the text colour should be black. I don't fancy doing this...

about icon background in vista
hi, all: i meet a curious thing. i make a icon using vc2005, and the backgournd of icon is transparent. i draw it to a dialog. in xp, it is right, the backgournd is transparent. but when aero is enabled in vista, the background is wrong, change into white. i find a way to solve this i get the dialog 's dc ,and create a bitmap. draw icon on the bitmap, and then draw bitmap to dialog's dc. the code like below int lWidth = rtClient.right - rtClient.left; int lHeight = rtClient.bottom - rtClient.top; RECT rcWindow; ::GetWindowRect(hDestWindowOverride, &rcWindow); HDC hDCDisplay = ::Cr...

Custom Background Issue
First, I am not even close to a professional computer anything! Last week I pulled in picture to use as a background for a flyer that I am doing. Everything was fine- it printed fine and was viewed fine. Yesterday I received a new "template" from our design company and did exactly the same things and when I pull it in to the more backgrounds area it looks fine on the background panel and in the print preview area. Yet the screen where you insert text boxes or design your flyer is black and I can barely see the background. Please help! -- T What happens if you insert the back...

Button background
Hello, I need to change background color of single button (CButton) in dialog. How can it be easily done? Thank you! >I need to change background color of single button (CButton) in dialog. How >can it be easily done? It can't be easily done. I believe the only option is to make it an owner drawn control. Dave -- MVP VC++ FAQ: http://www.mvps.org/vcfaq ...

Messages at the Background
I am relatively new with preparing accounting reports. In the spreadsheet I am working with, I saw that except the print areas, the entire spreadsheet was grayed out. I wonder how that was done. I know how to gray out a range of cells, but don't know how to do it for the entire spreadsheet. The other thing I noticed was that within the printed area, there was the nice information painted at the background indicating page numbers. This page number will not be printed out if I select print. And I don't know how that was done either. Hope someone will help me with these questions. ...

Transferring a Sum total w/o the background formula
"How do I transfer a sum total from one cell to another spreadsheet w/o transferring the formulas behind it? When I paste the sum I usually get !ref because the formulas are related to data in the original spreadsheet. Max Copy the cell but then use PasteSpecial | Values to get the value rather than the formula Regards Trevor "Max in NJ" <anonymous@discussions.microsoft.com> wrote in message news:BA3C77DF-5715-4E62-BA6E-62CDB083FC2E@microsoft.com... > "How do I transfer a sum total from one cell to another spreadsheet w/o transferring the formulas behind it?...

background colour of sheet gone gray need to change to whit
On jst one sheet in my book of several sheets the background has turned gray. I copied it and it was still gray. How do I change it back to white. Try clicking on VIEW > NORMAL Vaya con Dios, Chuck, CABGx3 "Change Background colour of worksheet" <Change Background colour of worksheet@discussions.microsoft.com> wrote in message news:24CA1CF3-AA1C-475A-814B-53023C214675@microsoft.com... > On jst one sheet in my book of several sheets the background has turned > gray. > I copied it and it was still gray. How do I change it back to white. ...

I want to make a two tone chart background
I am creating a chart and want the chart background above a certain value to be of a different color (to indicate a maximum allowable value has been exceeded). An alternative would be to jus have the gridline & axis value of a different color/thickness/etc Basically, you'll need to create some dummy series. Jon Peltier gives excellent examples of how to create horizontal bands here: http://peltiertech.com/Excel/ChartsHowTo/HorizBands.html Other background fills: http://peltiertech.com/Excel/Charts/BackgroundFill.html -- Best Regards, Luke M *Remember to click "yes"...

How to receive email with outlook closed (running in background)?
I have a network of all outlook 2003 users, and 2003 exchange server. My problem is that newer users are not opening outlook when they come in for work - so they are missing all their email (untill they remember to open it). Is there a way to make Outlook run in the background and/ or load when the system boots up? I would like the users to receive email constantly throughout the day, even if they forget to open outlook. Any ideas?? Thank you!! Chris Either put a shortcut to Outlook in their startup folder or train them to open Outlook once they have logged on to Windows. Outlook m...

Background color in Outlook 2007
I know how to change the background color of my own calendar. However, if I have been given access (shared permissions) to another person's calendar, can I change the background color of that calendar on my computer? Thanks. No. Outlook assigns the color. -- 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...

Change background color
Hello, I would like to write a function to change the background color of a range based on the date in the first column. I am not very familiar with VBA's objects though. This is what I had: Private Sub Worksheet_Activate() Dim y As Integer, strRange As String ' Ideally, I would like to go to the last row, but 200 will be ' sufficient for my purposes For y = 0 To 200 If Month(Now) = Month(Worksheets(1).Cells(y, 0)) And _ Year(Now) = Year(Worksheets(1).Cells(y, 0)) Then ' Highlight this row (columns A to L) strRange ...

task background color dont stay intact
Hi i put the background color in task & tried on shell also to blue or any other color and save the project and checkin. when i open the project back clolor is gone ... how can i resolve the issue. Pleaes help its project 2007 with professional 2007. You may be trying to modify an enterprise view. Try making a local copy of the view, and then changing the color. - Andrew Lavinsky Blog: http://blogs.catapultsystems.com/epm > Hi i put the background color in task & tried on shell also to blue or > any other color and save the project and checkin. > >...

EXCEL
When I colour a word or number and fill the cell with a colour it previews and prints as requiredd but views black only on screen. Hi Four Jays, See the MSKB article # 320531: "Changes to the fill color and the fill pattern are not displayed in Office programs" http://support.microsoft.com/?id=320531 --- Regards, Norman "Four Jays" <Four Jays@discussions.microsoft.com> wrote in message news:358BA13E-8E7B-4E9D-8186-E2EDD6DC2851@microsoft.com... > When I colour a word or number and fill the cell with a colour it previews > and prints as require...

CListCtrl
Hi, After sorting my listcontrol, the function FindItem will always return -1 when looking for and item that is not on the top. I set up LVFINDINFO as follows: flags = LVFI_STRING | LVFI_WRAP; psz = mystring; also I tried: flags = LVFI_PARAM; lParam = (LPARAM)&myObject; Does anybody has any suggestion? Thanks, Lubomir Lubomir wrote: > After sorting my listcontrol, the function FindItem will always return -1 > when looking for and item that is not on the top. > > I set up LVFINDINFO as follows: > flags = LVFI_STRING | LVFI_WRAP; > psz = mystring; Can you give an ...

Drawing Backgrounds
I have attempted to put built-in backgrounds into Visio 2003 drawings, and they all have a "washed out" appearance. Is there anyway to enhance the colors? Thank you Marsh On Fri, 29 Feb 2008 11:58:03 -0800, Marsh <Marsh@discussions.microsoft.com> wrote: >I have attempted to put built-in backgrounds into Visio 2003 drawings, and >they all have a "washed out" appearance. Is there anyway to enhance the >colors? That is the colours they are supposed to have, but you can edit them to suit your owen preferences. You can either edit the background shape o...

How to fix Forward text colour?
Using MSO 2000 SP3 at home, MSO 2000 SP 1 Corporate or Workgroup at work. When I forward a message the ink colour of my forward is not consistent and changes, seemingly randomly, from one message to the next. How do I make it the same each time? Can I pick which colour it uses? I use MS Word as my email editor, does this have anything to do with it? -- Regards. Chris. Please remove MAPSON (NOSPAM backwards) to reply to me by email. If you have Themes turned on (Format->Themes in Word) check to see if that is what is causing the different colors. I prefer using a theme in Word to ...

How do I change the colour to a block of bars?
Rather than change each bar individually is it possible to highlight a number of bars and change their colour in one operation? By "bar" I assume you mean the Gantt Chart bars? Select all the rows, individually or in block(s), then Menu: Format/Bar. You select rows by clicking in the ID columns (by default it's the extreme left column in the Gantt Chart view). --rms www.rmschneider.com On 23/04/10 12:15, 542779 wrote: > Rather than change each bar individually is it possible to highlight a number > of bars and change their colour in one operati...

label background should be the same as its parent's background
hi all, unfortunately i can not use SetBkMode(TRANSPARENT) to set my labels transparent (for some gui look and feel reasons) so i have to make my label's background identical with its parent's background.. i already tried the following (using VC++ 6.0) : HBRUSH CPgLabel::CtlColor(CDC* pDC, UINT nCtlColor) { static CBrush Bkgnd; CWnd* pParent = GetParent(); ASSERT_VALID(pParent); CDC* pParentDC = pParent->GetDC(); ASSERT_VALID(pParentDC); Bkgnd.DeleteObject(); COLORREF parentBgColour = pParentDC->GetBkColor(); pDC->SetBkColor( parentBgColour); ...