Using CListCtrl to create my own Print Manager
MICHAEL@datatree.com Wednesday, July 10, 1996 Environment: VC++ 4.1 and Windows 95 I have a CListCtrl status window which functions very similarly to Microsoft's Print Manager. I.E., new files to be printed are added to the bottom of the list and the status in the last column is constantly being updated. I found Microsoft's sample programs lacking in two areas. 1) If the text for a single row changes in one column, what is the preferred method for updating the view? 2) If a row is to be added to the end of the list, how is this best accomplished? In both cases, my existing code causes the entire list control to be repainted. --------------------------- Michael L. Thal Data Tree Corporation voice: (619) 231-3300 fax: (619) 231-3301
Simmi -- ARORAS@netsoft.com Tuesday, July 16, 1996 To answer your second question, this is how I add to the end of the list and it seems pretty efficient: LV_ITEM lvitem; static int row = 0; . .... . lvitem.iItem = row; . ... . m_listCtrl.InsertItem(&lvitem); . ... . row++; // Do it at the end of Insert Loop or your function which adds files Hope it helps... - Simmi > ---------- >From: owner-mfc-l[SMTP:owner-mfc-l@netcom.com] >Sent: Wednesday, July 10, 1996 12:08 PM >To: mfc-l >Subject: Using CListCtrl to create my own Print Manager > >Environment: VC++ 4.1 and Windows 95 > >I have a CListCtrl status window which functions >very similarly to Microsoft's Print Manager. I.E., >new files to be printed are added to the bottom of >the list and the status in the last column is >constantly being updated. > >I found Microsoft's sample programs lacking in two >areas. > >1) If the text for a single row changes in one column, > what is the preferred method for updating the view? > >2) If a row is to be added to the end of the list, how > is this best accomplished? > >In both cases, my existing code causes the entire list >control to be repainted. > --------------------------- >Michael L. Thal >Data Tree Corporation >voice: (619) 231-3300 >fax: (619) 231-3301
| Вернуться в корень Архива |