Archived

This topic is now archived and is closed to further replies.

Another fun MFC problem

This topic is 6166 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to quickly slap together a program that puts a list on the screen and lets me edit its contents. I created an app with the wizard and selected CListView as the view. I can make it display the list, but it has a *little* problem. The list goes across instead of down! I want one item per line, so I can have headings and multiple columns. I am still in the testing phase, so i just populate the list with a couple of calls to InsertItem(). I think I will have another problem trying to figure out how to load my data from a file, but right now I want to be able to view the stuff correctly. I can''t find any member function that will let me change the view type.... please help. --------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

You are unique. Just like everybody else.

"Mechanical engineers design weapons; civil engineers design targets."

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

Share this post


Link to post
Share on other sites
When I read that, the first thing that popped into my head was "Are you suggesting that coconuts migrate?" from a Monty Python movie. But to bring that into the programming realm, do you mean that I chose the wrong type of control? It seems like the one I want... after all, I want a LIST of ITEMs in COLUMNS (all of which are supported by list controls, which I know from using them in dialog apps). It is just a matter of setting the style. In dialog apps, you can set the style in the resource editor. How do I do it if the whole view is a list control and all I have to work with is the control object itself? Any further help would be great.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming


You are unique. Just like everybody else.


"Mechanical engineers design weapons; civil engineers design targets."

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

Share this post


Link to post
Share on other sites
No, CListView is the right view.

Microsoft''s online MSDN hel explains all of the functions for using CListCtrl and CListView: http://msdn.microsoft.com/library/default.asp?URL=/library/devprods/vs6/visualc/vcmfc/_mfc_clistctrl.htm

Share this post


Link to post
Share on other sites
It is because you didn''t set the style of the listbox to report...(LVS_REPORT). Just don''t forget that you need to create column headers (using InsertColumn) before being able to see anything in the list. Don''t forget to set the size of the columns to an acceptable width or the report won''t show properly.

Hope it helps. Ask away if it doesn''t.

Daniel.

Share this post


Link to post
Share on other sites
Dan, you have confimed my suspicions . Now if you could just tell me how to set it to report view, I think I could at least make a little progress before I run into another problem worthy of a gamedev post . Thanks.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming


You are unique. Just like everybody else.


"Mechanical engineers design weapons; civil engineers design targets."

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

Share this post


Link to post
Share on other sites