CListCtrl draw question

hi there

i have implemented a CListCtrl which displays graphic images as normal
icons

i have created for each item in the list several images relating to
unselected, selected, drophilited, and hover states, and have written
the code to update the image item index when the appropriate events
occur

all is going well, except i have one last 'issue' i would like resolve
- when an item is selected in LVS_ICON mode in a CListCtrl, the icon's
text is painted white on blue, and the icon has some kind of 'mask'
applied to it to appear selected - i would like to prevent the icon
(which is my image file) from being 'masked' , as it ruins the image
visually - i would just like the setting of the item's image (which i
already do) to give visual feedback to the user

what is the simplest way to achieve my goal?

ta muchly
bhu

0
bhuvidya (34)
8/13/2006 1:13:28 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
629 Views

Similar Articles

[PageSpeed] 22

You could do this with a custom-drawn CListCtrl.  See "Neat Stuff to do in
List Controls Using Custom Draw" at
http://www.codeproject.com/listctrl/lvcustomdraw.asp

The section titled "Handling the Post-Paint Draw Stage" (towards the end) is
what you want.

Mike


"bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message
news:1155474808.000690.163750@h48g2000cwc.googlegroups.com...
> hi there
>
> i have implemented a CListCtrl which displays graphic images as normal
> icons
>
> i have created for each item in the list several images relating to
> unselected, selected, drophilited, and hover states, and have written
> the code to update the image item index when the appropriate events
> occur
>
> all is going well, except i have one last 'issue' i would like resolve
> - when an item is selected in LVS_ICON mode in a CListCtrl, the icon's
> text is painted white on blue, and the icon has some kind of 'mask'
> applied to it to appear selected - i would like to prevent the icon
> (which is my image file) from being 'masked' , as it ruins the image
> visually - i would just like the setting of the item's image (which i
> already do) to give visual feedback to the user
>
> what is the simplest way to achieve my goal?
>
> ta muchly
> bhu
>


0
8/14/2006 8:50:14 PM
thanx a heap michael

that is _exactly_ what i wanted - his example at the end was what i was
aiming for, so all i had to do was cut n paste

you have made my day

cheers
bhu




Michael K. O'Neill wrote:

> You could do this with a custom-drawn CListCtrl.  See "Neat Stuff to do in
> List Controls Using Custom Draw" at
> http://www.codeproject.com/listctrl/lvcustomdraw.asp
>
> The section titled "Handling the Post-Paint Draw Stage" (towards the end) is
> what you want.
>
> Mike
>
>
> "bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message
> news:1155474808.000690.163750@h48g2000cwc.googlegroups.com...
> > hi there
> >
> > i have implemented a CListCtrl which displays graphic images as normal
> > icons
> >
> > i have created for each item in the list several images relating to
> > unselected, selected, drophilited, and hover states, and have written
> > the code to update the image item index when the appropriate events
> > occur
> >
> > all is going well, except i have one last 'issue' i would like resolve
> > - when an item is selected in LVS_ICON mode in a CListCtrl, the icon's
> > text is painted white on blue, and the icon has some kind of 'mask'
> > applied to it to appear selected - i would like to prevent the icon
> > (which is my image file) from being 'masked' , as it ruins the image
> > visually - i would just like the setting of the item's image (which i
> > already do) to give visual feedback to the user
> >
> > what is the simplest way to achieve my goal?
> >
> > ta muchly
> > bhu
> >

0
bhuvidya (34)
8/17/2006 12:19:17 AM
Reply:

Similar Artilces:

DrawingControl vs Drawing object
Hello, I have installed an evaluation version of Visio 2003 and I intend to integrate visio functionality into a VB6 application. In VB6 there are 2 activex objects available one is titled DrawingControl and the other is titles Drawing. When I attempt to use the one labeled DrawingControl, I get "Unspecified Error" when I attempt to place it on a form. What are the differences between the 2 objects and why would I be getting the error? I have the MS Press book and it doesn't even discuss these controls. TIA Vic ...

Resource dll question...
Hi there, I'm separating my project out into the main code and a resource dll. I've now got it so that when I build the debug solution it will build the following. MainExe - Debug ResourceDll - Debug French I intend to bundle all the languages into a single resourcedll, and build separate dlls from there depending on the build configuration ( E.g. MainExeFRA.dll) When I add another project config (E.g. Debug German) building the Debug solution will only build the existing Debug French. What I would like is that when I select to build the debug solution, it will build... Ma...

CListCtrl Header height change??
CListCtrl Header height change?? Is it possible to change the height of a CListCtrl Header.? Thanks Markus ...

Drawing Arrows
Hello Folks- I am trying to draw and arrow which is no problem using the automatic recording macro function is Excel 97. The problem comes in when I try to delete the same arrow using the same recording method. After all is done, when I run the "ShowArrow" it works fine, but when I run the "DeleteArrow" the macro fails? There will hopefully be multiple arrows on the spreadsheet. The VB error is "The item with the specified name wasn't found" The code is ActiveSheet.Shapes("Line 18").Select Selection.Delete Perhaps I need to identify t...

Custom POS buttons question
I would like to set up 10 custom buttons, but need help with the format. The first type I need is to be able to sell a certain item as an example the code 99595PE. Also what type of pictures can you have in the custom buttons do jpeg and gif's work? As for the 2nd type of button I need is a lot more complicated, I need a button that would make the current X report show on the screen. Our clerks end up printing out a lot of Xreports becuase they need to see if they need to do a cash drop or not through out the day. Any help would be appreciated. Look at RR RMS Utilities Store as we...

User Form Question
Hi, I have created a user form for entering names and addresses. I want the content of the form to go into the next row in a workbook when a button is pressed. I can get it to go to set cells but not the next free cells ? Any advice ? David Can't see your code but have a look at Offset method or defining LastRow in a range. Gord Dibben MS Excel MVP On Mon, 26 Jan 2009 19:51:19 +0000, David <davidjcleland@hotmail.com> wrote: >Hi, > >I have created a user form for entering names and addresses. I want the >content of the form to go into the next row in a workbo...

Simple question about competitors
I have started testing CRM 3.0 and am looking at the competitor functionality. Perhaps someone can clear up a slight confusion that i have. When i enter an account, i can classify that account as a competitor. When I go to the competitor page, I do not see the competitor there. Can anyone explain the relationship between the competitor entry against the account and the competitor list? Thanks very much Saira The "Competitor" selection on the Account form is just a description, whereas there is a full-fledged entity type for Competitors. I would just ignore the account type c...

Easy question for a query
I have a couple batches of shirts, 2-3 different styles. When items had been created in my system product descriptions had been left out. I'm familiar and just fine with understanding and writing queries but am lost on one thing. How the heck do I insert a linebreak into the description? Manually it's cake but time consuming...EG... update item set extendeddescription = 'blahblahblah(what goes here for linebreak?!)Next line of text...<br> etc...' Pretty simple question really, but yeah! Thanks for your help guys! ------------------------------------- ~~Newbie in way o...

Change Color for Drawing Line Object
Below is code for a line drawing, but it defaults to Blue. I would like to change the color to red. ------------------------------------------------ Sub mineLeft() Dim nStart1 As Double, nStart2 As Double Dim nEnd1 As Double, nEnd2 As Double Dim rng1 As Range Dim rng2 As Range Set rng1 = ActiveCell.Offset(0, -1) Set rng2 = ActiveCell.Offset(1, 0) nStart1 = rng1.Left + rng1.Width nStart2 = rng1.Top nEnd1 = rng2.Left + rng2.Width nEnd2 = rng2.Top ActiveSheet.Shapes.AddLine(nStart1, nStart2, nEnd1, nEnd2).Select End Sub -----------------------------------------------------...

relates to previous question regarding memberships cards and intia
Hi,before i start my next question i would just liek to say thanks to everyone who replied to my earlier quetions it is much appreciated,the next question i have is related to the question regarding the membership cards i wanted to create.I made the query as told and it works great! Left([FirstName],1) but how do i get the query to run when opening the report to display the bales ?? thanks On Wed, 16 Jan 2008 11:49:03 -0800, newuser <newuser@discussions.microsoft.com> wrote: >Hi,before i start my next question i would just liek to say thanks to >everyone who replied ...

Problems with CListCtrl
I'm having trouble with a CListCtrl object. I'm trying to automatically set the selected items of the list from my code. I try the following statement: m_List.SetItem (pos, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, LVIS_SELECTED, 0); The SetItem function returns non-zero, which supposedly means it was successful. However, I don't see any selection showing up. I even called RedrawItem on this list item, but it didn't help either. Anyone know about this? -Eric >I'm having trouble with a CListCtrl object. I'm trying to automatically >set the selected ite...

CTreeCtrl and CListCtrl problem
I use create a single document struct using MFC(explore style).The left of the window is CLeftView class(which inherit CTreeView).The right is CBrowserView which inherit CListView.I want to display the content of a directory in the right(CListview) when user click the item of the ctreectrl. In the LeftViw I add method "void CLeftView::OnClickItem (NMHDR* pNMHDR, LRESULT* pResult)" because I want to know which item be clicked by user. ////////////////Leftview////////////////////// CTreeCtrl& mtree=GetTreeCtrl(); HTREEITEM item=mtree.GetSelectedItem(); data=mtree.GetItemDat...

Office 2010 Buying Question Assistance Needed
I've been looking through the MS Office 2010 web site to try to determine what my new small company would require, but I can't find the information I need. We for sure would need Office Pro Plus, but other than that I'm not sure. We want to run it on our own server. We will initially have 3-5 people using it and perhaps more later on. Would we need to purchase site licensing? Unfortunately, our programmers are MS haters (I'm not) and I can't get any assistance from them on this, but I have power of the pen. I would appreciate any assistance I can get. Th...

Mail merge question
This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C81A17.BAB51A20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I've been reading about mail merge, setting up postcards, etc. I remember doing this when I did the tutorials in Publisher 2000, but = still not sure about it (I've never had to actually use it, but have a = few ideas about using it for postcards for people I have made flyers = for) What is the best program to make the mailing list in? I now have 2007 = and have Word (I know enough about to...

RS 2008 Charts Question
I am using RS2005 moving to RS2008 shortly. My question is: in RS2008 if you build a bar graph chart, can you click on one of the bars and display the data that makes up that bar? I know you can do this in Report Builder but is this funcionality available outside of Report Builder? ...

newfish's question:HOW TO make a sniffer using winsocket in vc++6.0 ?
Hey all, I need a sample about sniffer .any one could help me? please...~~ What do you mean by "a sniffer"? I have an idea what this kind of program does so perhaps it's more appropriate to ask what you are trying to sniff? Tom "feizx" <feizx@126.com> wrote in message news:uve3p3xjHHA.1776@TK2MSFTNGP05.phx.gbl... > Hey all, > I need a sample about sniffer .any one could help me? please...~~ > WireShark (formerly known as Ethereal) is an open source packet sniffer. Start there. joe On Sat, 5 May 2007 22:01:41 +0800, "feizx" <...

Follow up to Calculated Field question .....
The syntax worked fine for that. Now I'm wondering two more things ... In one of the tables I have multiple identical room numbers that I need to combine in this calculated field to determine a price for each room. Plus, I also need to determine a number for income generated based upon the number of days the romm is rented. Can you point me in the right direction? Thanks ...

CListCtrl and sub item editting
Hi, Is it possible to implement CListCtrl sub item editting without creating a custom ctrl? I am using VS2003. TIA Tony >Is it possible to implement CListCtrl sub item editting without creating a >custom ctrl? Tony , There's no built-in support for this, so no, you have to provide some implementation for this. Have a look on sites such as CodeGuru and CodeProject, they'll have examples. Dave Thanks Dave, I've seen examples, I just wasnt sure if I needed my own ctrl. Regards Tony "David Lowndes" <DavidL@example.invalid> wrote in message news:k...

Windows XP system restore points question
I have had this system for about a year and a half with no problems and have the daily system restore points and system restore points for when I installed / removed / updated software for that time. Question is how far back should I keep the restore points or files or whatever?? Room is not a problem for now so keeping them all is no big deal but I was just wondering. Thanks much. "kraut" <kraut3852@yahoo.comg> wrote in message news:29nav5hbcmh3f1h7iaofjunka2ac1q407n@4ax.com... > > > I have had this system for about a year and a half with n...

How to draw out a bar chart backed by a 3-dimension database
Hello everyone: I've a problem: I'm drawing a population pyramid bolstered by a 3-dimensional database, with the population as the only figure to display, and break up by gender, age group, and record year; e.g. Year Gender Agegroup Population 2000 Male 10-14 200000 1999 Female 5-9 1340000 I've got a total 2 years in year break up, 2 gender types, male & female, and about 10 age groups; What I wanna to do is to generate a bar chart, with age break displayed on the vertical axis, population displayed on the horizontal axis, and break up ...

AD/Network design question
Hello all I have a 2 sites which users come and go from. These sites have 2 different network ip domains (192.168.1.x and 192.168.2.x). Users need to be authenticated using the same user id and password at both sites. DC/GC is at 192.168.1.x and is a SBS 2003. Server at 192.168.2.x is Server 2003. When the server at 192.168.2.x is connected via vpn to 192.168.1.x all is well. How do I get the server at 192.168.2.x to act as a AD/DC when it’s not connected to 192.168.1.x ? Thank you Hal I think you will run here into the limitations of SBS :-( @ SBS experts : ...

Questions
how do i change from microsft exchange to pop3 in outlook 2007. The program wont stay open to use the tool menu. it tells me its not connected and closes out the window. "krzatchok" <krzatchok@discussions.microsoft.com> wrote in message news:1749B22A-69E3-430A-9032-CD73005440E2@microsoft.com... > how do i change from microsft exchange to pop3 in outlook 2007. The program > wont stay open to use the tool menu. it tells me its not connected and > closes > out the window. Use the Mail applet in Control Panel. -- Brian Tillman [MVP-Outlook] ...

Permissions and Roles question
This may be a Reporting services question, sorry if wrong NG. I created a number of roles in Active Directory to limit access to reports in the Management Portal for Job X. Initially, I created a role for each report and then added groups to those roles. After getting this all set, I determined that it would probably be a better idea to set up more general report roles that could encompass groups of reports rather than individual reports. I deleted most of the original roles I created and created new roles to serve this new structure. Now, when I hit AD for a list of groups to se...

How to add clistctrl into clistctrl?
How to clistctrl into a clistctrl? For example like adding checkbox , combobox, i want to add clistctrl into a clistctrl ...

cant draw connector lines between 2 shapes
at http://office.microsoft.com/en-us/excel/HP051922291033.aspx it shows how to draw a connector line(s) - says applies to Excel 2003 (which I am using Excel 2003). I follow the instructions (below) but no connector line appears. Why would this be? -On the Drawing toolbar, click AutoShapes, point to Connectors, and then click the connector line you want. -Point to where you want to attach the connector. -Connection sites appear as blue circles as you pass the pointer over a shape. (I am not getting the blue cirlces here) -Click the first connection site you want...