How to show objects in a ListBox depedent of their state??

Hi,

In my Documentclass is a list of Objects. This objectlist I want t
display in a ListBox that sits on a CFormView, which is connected t
the document class. Secondly it is necessary, that the ListBoxentrie
are diplayed according to the status of the actual object. For exampl
one ListBox-Entry shall be green and the other one shall be red....

I derived my own ListBox-Class and overwrote the drawItem()- an
measureItem()-method, but I think, in these methods I should get acces
to the actual object to be displayed....How can I do this??? I mean, 
filled the List with
"m_ListBox.AddString(doc->getObjectList()->getElementAt(1).toString());"

Is there maybe a better way?? Does anybody know what to do in order t
show objects in a Listbox???


-
wayneschlege
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------
 
0
12/14/2005 8:06:53 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
401 Views

Similar Articles

[PageSpeed] 31

wayneschlegel wrote:
> Hi,
> 
> In my Documentclass is a list of Objects. This objectlist I want to
> display in a ListBox that sits on a CFormView, which is connected to
> the document class. Secondly it is necessary, that the ListBoxentries
> are diplayed according to the status of the actual object. For example
> one ListBox-Entry shall be green and the other one shall be red....
> 
> I derived my own ListBox-Class and overwrote the drawItem()- and
> measureItem()-method, but I think, in these methods I should get access
> to the actual object to be displayed....How can I do this??? I mean, I
> filled the List with
> "m_ListBox.AddString(doc->getObjectList()->getElementAt(1).toString());"
> 
> Is there maybe a better way?? Does anybody know what to do in order to
> show objects in a Listbox????

Your DrawItem code can use the passed-in itemID to access the text of 
the item to be painted.  If that is not sufficient information then you 
can use SetItemData to store a pointer to the object inside the list 
box.  Then the passed-in itemData gives the pointer to DrawItem.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
12/14/2005 1:28:09 PM
Reply:

Similar Artilces:

Automation object in office template
I’m not sure which area to post this in. Anyway, I’m trying to use an Access 2007 template (nutrition) I found on MicroSoft’s site, but in 2003. I downloaded it on a co-workers computer, saved it for 2003 and opened it on my computer. Right off the bat I get a “The object doesn’t contain the Automation object ‘IsTrusted’” message. I have no idea what this means and how can I fix it or get rid of it. Any ideas? Thank you! If the database format is accdb, you will have to cobvert it to an mdb using Access 2007, before you can use it in Access 2003. The accdb format is not b...

Adding shadows to tables or objects
I have a table and want to add a shadow. Would think this would be fairly simple, but have not yet found the key! I have tried the 3-D toolbar, but it is disabled. not sure how to enable it. Thanks! To add a shadow to a table is more or less hit and miss. Select the table, fill the cells white, draw a rectangle the size of the table, color it, send it to the back, while the rectangle is selected, open the shadow dialogue and adjust. Most simple objects can have a shadow inserted. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com ...

Show one total summary but have drill down to detail
I am working a spreadsheet that totals for certain categories. Frequently it is necessary to see the detail that made up that figure. Right now I am using comments but this laborious. I'm not sure if pivot tables are what I need or not. Basically I have a total and would like to mouse over or something and go to a different chart/page to see the breakdown. Hi use a pivot table. See: http://www.cpearson.com/excel/pivots.htm http://peltiertech.com/Excel/Pivots/pivotstart.htm http://www.contextures.com/xlPivot02.html http://www.ozgrid.com/Excel/excel-pivot-tables.htm http://www.techonthe...

How do I make excel hide columns when it says cannot move objects
I select columns and try to hide them. Excel says it cannot shift objects off the sheet. I try goto objects and it says there are no objects on the sheet. I cannot hide or resize the column widths of certain columns. I cannot figure out why I can't get it to work and hide or resize the columns. Does anyone have any idea how to fix the columns so I can hide/resize the columns? It only does it on some of the columns, not all of them. I can't find any objects to delete. ...

Graphs on webpages generated from Excel do not show
Graphs on webpages that I generated through Excel's save as webpage function do not show anymore on my pc but do show on other's pcs. Does anybody know a solution ? (our company helpdesk does not). I use Office 2000 and Internet Explorer 6 SP1. ...

hide show question
I have names in col A that go from row 1 to row 1000 I then place data(numbers) in col B that corresponds with the name in col A. Once done I show ONLY the rows that have new data(filter)and use the SPEAK function to read the data back to me. Here is the tough part. On subsequent weeks I enter data in col B again and I want to be able to apply the SPEAK function BUT ONLY to the LAST set of inputted data. aDoes anyone have a good way to implement htis Thanks Hi, It sounds like you need to add a date column to your data so you can filter on that. -- If this helps, please click the Yes...

wrapping rtc com object in a CWnd
hi, would this be the right way to wrap the rtc com object in a CWnd: For startup, call CoCreateInstance in the CWnd::InitInstance -- or should I have OnWindowPosChanged call it, see: http://blogs.msdn.com/oldnewthing/archive/2006/09/25/770536.aspx For shutdown, call PrepareForShutdown in CWnd::OnClose and have RTCCET_ASYNC_CLEANUP_DONE call CWnd::PostNcDestroy ? I thought of wrapping it in CWnd instead of CWinThread because the Com object is an invisible window (right?) and during shutdown sometimes my app shuts down before RTCCET_ASYNC_CLEANUP_DONE has a chance to get called. thanks ...

A report that shows PayOuts
Sorry to repost, i know there is an thread here for this question, and a nice lady name Jessica at GreenCoast answered with an attachment. Unfortunatly, my newsreader doesn't appear to want to d'l threads that old. So I'm hoping that someone can help me by posting a template? I have tried to create my own report but i'm not having very much luck. I can't even get the report to display the amounts of the PO's. Any help would be appreciated. Thanks Wil Jepsen will@cjeateries.com This is a multi-part message in MIME format. ------=_NextPart...

Showing number of day of year
Is it possible to show the number of the day in calendar view. On many desktop calendars, the number of the day of the year is printed on the caledar. If you have a specified number of days to perform a task, you can use this to find the date that a certain task has to be performed. I have not been able to find this function anywhere in Outlook 2000. Anyone have a solution??...or at least let me know it cannot be done so I can quit wasting my time looking. I'd appreciate your help. Thanks. ...

Publisher 2003 does not show all fonts
Greetings All, I have a problem that I think is related to the "Font Schemes" of MS Publisher 2003. The facts: Have MS publisher 2003 installed. Have many, mnay truetype fonts installed on the system All my truetype fonts show up in fonts list under MS Word, Excel, etc. I have a web site that I created using one of the MS Publisher templates. The problem: When I open the web site that I created (opne the .pub file) to edit it, only a few fonts show up in the drop-down list. I think the Font Scheme of the templat ethat I chose is limiting the fonts that are displayed, but fo...

outlook webaccess does not show contact names #2
Greetings, I have just installed exchange 2003 and do not see any names in the contact list while using outlook web access. Using regular outlook I have many many names in my contact list but it is not showing when I use OWA. Normally i create new mail, click "To" button and my list of contacts appear. Is there anything on the server end I need to set for thit to work in OWA? ...

Wrting Browser Helper Objects
Hello, This is my first time working on BHO and I really don't have a clue what to do. The MSDN site talks about creating "IObjectWithSite" object and says that "if you add such an object to your ATL project, and call the corresponding class CViewSource, you get the following code from the wizard: class ATL_NO_VTABLE CViewSource : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CViewSource, &CLSID_ViewSource>, public IObjectWithSiteImpl<CViewSource>, public IDispatchImpl<IViewSource, &IID_IViewSource, ...

Interest Charges showing as spent money in budget
When I reconcile my credit card account, I add the monthly interest as Interest charge: (Category) Bank Charges, which was the default category when I started. Anyway, the credit card interest shows up in my budget as if I actually spent the money to pay the interest. I have a running balance on my credit card and would just like to have the interest recorded on my credit card activity and not as if I paid money. Note: My credit card is listed in Scheduled Bills and also the Debt Reduction Planner. Any help is appreciated. In microsoft.public.money, Violet wrote: >When I...

Legend Needs to show numbers...HELP
How can I get the values percentages to show up in the legend? I hvae 4 sales reps and the value of theri %'s. In the legend it only shows the 4 sales reps. Since I'm printing in black and white I want the legend to show the sales rep name and the %'s. Is this possible? If you only have four sales reps, you could remove the legend, and show each rep's name and percentage on the chart. You could also remove the fill colour, to make the labels easier to read. Roberta wrote: > How can I get the values percentages to show up in the legend? > > I hvae 4 sales re...

Excel opened a file but did not show it's contents
Hi all, One of my colleagues tried to open an Excel file. Excel opened the file (no error was shown up) but it didn't show the contents of the file. If you have 2 files originally opened in Excel, Excel only shown those 2 file windows in it. The newly opened one disappeared. Have anyone of you came across this before? Any ideas to fix the problem are welcome. TIA el Does this mean you looked under the Window option on the menubar and didn't see all the workbooks that you think you opened? If you could see the name, maybe it's just off the visible screen: Window|Arrange|ti...

w2 and State information
This year the W2 grabbed the state information from the company information card, but used only the first 2 characters, so if in my company information I had Missouri as the state, W2 listed the state as MI. GP needs to either limit the state designation to 2 letters in the company info page or change the way state W2 info is taken from within GP. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, foll...

City and State Populated by Zip Code
Does anyone know of a way to load a program that when you type in the Zip Code the City and State are automatically populated? I have seen a MSCRM add-in from a company called QAS (http://www.qas.com/). This is more than just Zip Code/City&State. It's a full address validator along with streamlined data entry. They have integrated with CRM via an ISV pop-up and it seems to work fairly smoothly. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On 15 Apr 2005 11:13:56 -0700, "Morgan" <tzeoli@att.net> wr...

Outlook version of CRM is showing inactive account as well when searching....
Hi there, We have a client who has an issue where when you are in Outlook version of Microsoft CRM and do a search on account, inactive accounts come up as well. But this doesn't happen on web version of MSCRM, web version of CRM only list active accounts when searching. Has anybody come across this before? Regards, Kyaw Hi Kyaw, Are they offline or online? If Offline, what happens when they go Online? And then back Offline? Stephen "Kyaw" <no@spam.net> wrote in message news:%23ePPJ4YqEHA.3876@TK2MSFTNGP15.phx.gbl... > Hi there, > > We have a client ...

recurring appointments showing incorrectly by 1 hour
I have performed all microsoft updates but since the time change Sunday, recurring appointments in the public folders are off by one hour in March but in April and on after the normal time change the appointments are at the correct time. Is there something by way of a patch or change that needs to be made with exchange? All single appointments are correct and email is showing the correct times it is just recurring appointments and in March only. Try running tzmove.exe for outlook on each public folder with the switch -onlyreoccuring and it should try and move the reoccuring meetin...

How to Accurately Show Interest Payments in Home Equity Loan
This is driving me crazy. Does anyone have a good workaround? I transfer $1000 out of my checking to my Home Equity Loan in MS Money. Checking statement show $1,000 going out (nice and simple to reconcile) Home Equity Loan statement shows $951 coming in and $49 interest payment ($1,000 total). It appears MS Money can't split the transfer into 2 transactions (one for the principal and one for the interest) to coincide how the bank shows the transaction. Any ideas? Thanks. Thanks. Well, if entering transactions by hand, this is simple. Money can split the transaction into two co...

Footers show on print preview, but do not print in Word
In MS Office 07, Word, footers show on print preview, but do not print. HELP! See http://www.word.mvps.org/FAQs/Formatting/BottomsDontPrint.htm. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. jkress wrote: > In MS Office 07, Word, footers show on print preview, but do not > print. HELP! ...

multiple copies of contacts after sync, and only one category is showing in address book
I have a user who after synching contacts with his axim has 3 copies of each - how can I remove the unecessary ones? Also he has his contacts separated into categories and only one shows in the address book - how can I get them all to show? thanks in advance for your help. mleon he is using outlook 2003 michele.removeleon@toyoda-na.com <michele.removeleon@toyoda-na.com> wrote: > I have a user who after synching contacts with his axim has 3 copies > of each - how can I remove the unecessary ones? Select the duplicates and click Delete. > Also he has his contacts separated...

cannot insert objects or equations
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel After installing a new hard disk, I cannot insert an equation or other object (i.e. spreadsheet). The &quot;Insert equation&quot; menu item is grayed out, and no objects appear in the Insert Object's &quot;Object Type&quot; box. I have uninstalled Office, reinstalled it, and installed updates. What can I do to make it work again? This can get very ugly, depending on how you installed the hard disk in the first place. The Apple "Migration Utility" seems to make an unholy mess o...

embedding video object in excel 2003
I am trying to embed and avi file but get a driver not loaded message without identification of driver. Can anyone help? ...

how do I lock an object position in Publisher?
Put it on the background (Master Page) ctrl+m. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "babbs" <babbs@discussions.microsoft.com> wrote in message news:866F03CD-6D9A-4092-9798-26405826BBE8@microsoft.com... > ...