MFC list Control 控件设置

//m_ListProcess、m_ListModule是相应的控件变量,首先列表属性要选择report
CRect rect1,rect2;    


// 获取编程语言列表视图控件的位置和大小    
m_ListProcess.GetClientRect(&rect1);    
m_ListModule.GetClientRect(&rect2);    


// 为列表视图控件添加全行选中和栅格风格    
m_ListProcess.SetExtendedStyle(m_ListProcess.GetExtendedStyle() | 
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);   
m_ListModule.SetExtendedStyle(m_ListModule.GetExtendedStyle() | 
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);  
   
// 为列表视图控件添加三列    
m_ListProcess.InsertColumn(0,"序号",LVCFMT_LEFT, rect1.Width()/5, 0);    
m_ListProcess.InsertColumn(1, "进程名",LVCFMT_LEFT, 3*rect1.Width()/5, 1);   
m_ListProcess.InsertColumn(2, "进程ID",LVCFMT_LEFT, rect1.Width()/5, 2);   

//插入一行,并设置插入的内容
       CString str;
       str.Format("%d",i);
       m_ListProcess.InsertItem(i,str);
       m_ListProcess.SetItemText(i,1,Pe32.szExeFile);
       str.Format("%d",Pe32.th32ProcessID);
       m_ListProcess.SetItemText(i,2,str);


m_ListModule.InsertColumn(0,"序号",LVCFMT_LEFT, rect2.Width()/5, 0);    
m_ListModule.InsertColumn(1,"DLL名",LVCFMT_LEFT, 2*rect2.Width()/5,1);    
m_ListModule.InsertColumn(2,"DLL路径",LVCFMT_LEFT, 2*rect2.Width()/5,2); 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值