Listctrl insert data

Source: Internet
Author: User

If xxview inherits the clistctrl class, you can directly call the clistctrl & m_listctrl = getctrl (); function to obtain the listctrl pointer in the View class, and insert data through the m_listctrl operation.
If it is a clistctrl control, you need to define its own control variables.

I think many of my friends have defined the lvcolumn struct for data insertion, because there are many features, but I think it is quite troublesome.

So I like to use the following method:
Int nindex = m_listctrl.insertcolumn (m_listctrl.getitemcount (), STR );
M_listctrl.setitemtext (nindex, 0, str1 );
M_listctrl.setitemtext (nindex, 1, str2 );
M_listctrl.setitemtext (nindex, 2, str3 );
... It is convenient, but there are restrictions on the data type to be inserted.

In addition, set clistctrlCodeTo set the report format, you must add the following in precreatewindow:
CS. Style | =Lvs_report| Lvs_singlesel;
CS. dwexstyle = lvs_ex_gridlines | lvs_ex_fullrowselect;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.