多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
**1.xml布局** ```xml <List name="ListDemo1" float="true" pos="21,143,0,0" width="454" height="100" bkcolor="#FFFFFFFF" vscrollbar="true" hscrollbar="true" itemtextcolor="#FF000000" itembkcolor="#FFE2DDDF" itemselectedtextcolor="#FF000000" itemselectedbkcolor="#FFC1E3FF" itemhottextcolor="#FF000000" itemhotbkcolor="#FFE9F5FF" itemdisabledtextcolor="#FFCCCCCC" itemdisabledbkcolor="#FFFFFFFF" > <ListHeader name="domain" bkimage="./skin/FirstDui/List/list_header_bg.png"> <ListHeaderItem text="文件路径" width="200" height="23" minwidth="16" sepwidth="1" align="center" hotimage="./skin/FirstDui/List/list_header_hot.png" pushedimage="./skin/FirstDui/List/list_header_pushed.png" sepimage="./skin/FirstDui/List/list_header_sep.png" /> <ListHeaderItem text="扫描结果" width="84" height="23" minwidth="16" sepwidth="1" align="center" hotimage="./skin/FirstDui/List/list_header_hot.png" pushedimage="./skin/FirstDui/List/list_header_pushed.png" sepimage="./skin/FirstDui/List/list_header_sep.png" /> <ListHeaderItem text="状态" width="84" height="23" minwidth="16" sepwidth="1" align="center" hotimage="./skin/FirstDui/List/list_header_hot.png" pushedimage="./skin/FirstDui/List/list_header_pushed.png" sepimage="./skin/FirstDui/List/list_header_sep.png" /> </ListHeader> </List> ``` 2.在initWindow插入 行 ```c++ virtual void InitWindow() { CDuiString str; CListUI* pList = static_cast<CListUI*>(m_PaintManager.FindControl(_T("ListDemo1"))); for (int i = 1;i < 100; i++) { CListTextElementUI* pListElement = new CListTextElementUI; pListElement->SetTag(i);//多少行 pList->Add(pListElement); str.Format(_T("%d"),i); pListElement->SetText(0,str); pListElement->SetText(1,_T("haha")); } } ```