惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
雷峰网
雷峰网
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
V
V2EX
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium
Vercel News
Vercel News
美团技术团队
人人都是产品经理
人人都是产品经理
The Cloudflare Blog

博客园 - xxsdfsdf

匈牙利命名法 窗口句柄的获得 CString工作原理和常见问题分析 61条面向对象设计的经验原则-《OOD启示录》Arthur J.Riel 最近笔试面试,狂考sizeof ,大家一起学习 MFC下常用宏说明 MFC数据库操作笔记 终于解决了这个怪问题 获得OnOK退出控制 Afx全局函数及MFC常见数据类型 自画按钮 VC ODBC使用总结 Windows Mobile 5.0 中为开发人员提供的新功能 中国的盗版商怎么了? 夏天这么热公司居然不开空调...TMD... 晕啊。。好象MonoDevelop没有WINDOWS上的二进制安装版呢? Mono人物专访 Microsoft .NET Development Platform的Linux版本出现 唉。。英格兰的这场比赛太难看了。。
ListCtr的用法
xxsdfsdf · 2006-06-30 · via 博客园 - xxsdfsdf

//自己封装了一个插入List行的函数

int CMyListCtrl::insertRow(int nPos,int nNoOfCols,LPCTSTR pText,...)
{
 va_list argList;
  va_start(argList, pText);

 int nCount,nIndex;
 nIndex = m_pList->InsertItem(nPos,pText);
 for(nCount=1;nCount<nNoOfCols;nCount++)
  { LPCSTR p = va_arg(argList,LPCSTR);
    m_pList->SetItemText(nIndex,nCount,p);
  }
  va_end(argList);
 return nIndex;
}

//初始化ListCtrl风格,表头的函数

void CMyListCtrl::initListCtrl(CWnd *cwnd,int nID)
{
CWnd *m_cwnd =cwnd;
ASSERT(m_cwnd!=NULL);
//CListCtrl *m_pList = mlist;
  m_pList = (CListCtrl*)cwnd->GetDlgItem(nID);

 DWORD dwStyle= GetWindowLong(m_pList->m_hWnd, GWL_STYLE); 
 SetWindowLong( m_pList->m_hWnd, GWL_STYLE, dwStyle | LVS_REPORT);
  //设置ListCtrl可以整行选择和网格条纹
 DWORD styles = m_pList->GetExtendedStyle();
 m_pList->SetExtendedStyle(styles|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
 m_pList->SetBkColor(RGB(0xFF, 0xFF, 0xE0));
 m_pList->SetTextBkColor(RGB(0xFF, 0xFF, 0xE0));
 
    //设置列的题头
 m_pList->InsertColumn(1,"序号",LVCFMT_CENTER,40);
 m_pList->InsertColumn(2,"产品名称",LVCFMT_CENTER,100);
 m_pList->InsertColumn(3,"数量",LVCFMT_CENTER,40);
 m_pList->InsertColumn(4,"类型",LVCFMT_CENTER,80);
 m_pList->InsertColumn(5,"单价",LVCFMT_CENTER,40);
 m_pList->InsertColumn(6,"生产厂家",LVCFMT_CENTER,130);
 m_pList->InsertColumn(7,"消费日期",LVCFMT_CENTER,80);
 m_pList->InsertColumn(7,"备注",LVCFMT_CENTER,200);  
}