Editing in CListCtrl
Kuan Choon Cheit -- cheit@pl.jaring.my Monday, March 24, 1997 Environment: VC++ 4.0, Win 95 Hello, I'm using a CListCtrl to display an array of coordinates. I've successfully inserted two columns and several items. Now, I want to edit both columns when double-click the particular row (item). I use GetItemText, but how can I get the index of the item which is double-clicked. Because GetItemText() need this parameter. Do I need to call GetEditControl()? Second, how to fix the column width so that the end users CANNOT adjust the column width? Third, about callback list, does it mean the array of coordinates in this case? Thank you in forward.
Ajay K Sanghi -- sanghi@giasdl01.vsnl.net.in Tuesday, March 25, 1997 [Mini-digest: 2 responses] 1)Use the GetNextItem() function with the LVNI_SELECTED to=20 get the index of the selected item. 2)To disable the change of size of the columns use=20 SetColumn() fn with the proper LV_COLUMN structure. -----From: kevin@pln.com.tw (Kevin Tarn) 1. You can use CListCtrl::GetNextItem(-1, LVNI_SELECTED) to get the item= index of selected item. 2. I think that you should subclass the CHeaderCtrl within the CListCtrl= , so that it can fix the column width. Hope it can help. Kevin Tarn ---------- =B1H=A5=F3=AA=CC: Kuan Choon Cheit[SMTP:cheit@pl.jaring.my] =B6=C7=B0e=A4=E9=B4=C1: 1997=A6~3=A4=EB24=A4=E9 AM 12:39 =A6=AC=A5=F3=AA=CC: mfc-l@netcom.com =A5D=A6=AE: Editing in CListCtrl Environment: VC++ 4.0, Win 95 Hello, I'm using a CListCtrl to display an array of coordinates. I've successfully inserted two columns and several items. Now, I want to edit both columns when double-click the particular row (item). I use GetItemText, but how can I get the index of the item which is double-clicked. Because GetItemText() need this parameter. Do I need to call GetEditControl()? Second, how to fix the column width so that the end users CANNOT adjust t= he column width? Third, about callback list, does it mean the array of coordinates in this case? Thank you in forward.
Become an MFC-L member | Вернуться в корень Архива |