Home > Back-end > The basis of problems related to the MFC
The basis of problems related to the MFC
Time:02-13
C + + MFC, how to write a program to the list box to add content?
CodePudding user response:
CListCtrl m_ListCtrl; M_ListCtrl. InsertColumn (0, "the first column", NULL, 100, 1); M_ListCtrl. InsertColumn (1, "the second column", NULL, 100, 1); LV_ITEM lvItem; LvItem. Mask=LVIF_TEXT; LvItem. The iItem=0;//first line LvItem. ISubItem=0; LvItem. PszText="the value of the first line of the first column"; M_ListCtrl. InsertItem (& amp; LvItem); M_ListCtrl. SetItemText (0, 1, "the value of the first line of the second column");