我的CListCtrl空间采用Report模式,有3列,N行,有个很奇怪的问题,插入3行以上数据才能正常显示,插入第一行时只能显示第一列,插入第2行时只能显示前2列,插入第3行以后就全正常了,咋也找不到问题,很奇怪,请高手指教,就是说插入3行以上就全部显示正常
解决方案 »
- 这个sql语句怎么写
- 为什么CListBox会输出乱码啊?大家帮帮忙哈,谢谢
- 求 Visual C++图形用户界面开发指南(李博轩著) 源码!
- QueryInterface问题
- 请问有没有比较成熟类库(打包好的,要求尽量的多、全)下载?我想高手们肯定有自己的类库吧!能不能共享一下,菜鸟们应该是非常需要的。
- 求:XML学习资料,来着有分!!!
- 我想从一个网段收取数据.转发到另一个个网段,200个字节为一个单位,其中第一个和第二个字节为同步字"0xEAE0",如何做?清帮帮忙.谢谢.
- 哪个知道怎么转换音频格式啊(Vox->Wav)
- vs2010怎么把一个常规的dll工程改成扩展dll??
- 这儿人多,我问问这里!我的IIS问题,别的计算机访问网站,老是要网络密码!
- imap协议哪里有?
- 请问 CArray 怎样释放
LV_COLUMN lvcolumn;
// Insert columns using the order field
for(int i = 0; i <3; i++)
{
lvcolumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH | LVCF_ORDER;
lvcolumn.fmt = LVCFMT_CENTER;
lvcolumn.pszText = rgtsz[i];
lvcolumn.iSubItem = i;
lvcolumn.iOrder = i;
if(i == 0)
lvcolumn.cx = 100;
else if(i == 1)
lvcolumn.cx = 100;
else if(i == 2)
lvcolumn.cx = 380;
m_ReportList.InsertColumn(i, &lvcolumn);
m_ReportList.Invalidate();
你的代码的意思好像就是每插入一个,跟新一下
m_ReportList.SetItemText(0, 1, "22222222");
m_ReportList.SetItemText(0, 2, "3333333");
UpdateData(FALSE);没啥问题
{
CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
} // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon//////////////////这个地方往下是复制你的,其他的都是自动生成的
// TODO: Add extra initialization here
TCHAR rgtsz[3][15] = {_T("状态ID"),_T("状态名称"),_T("说明")};LV_COLUMN lvcolumn;// Insert columns using the order field
for(int i = 0; i <3; i++)
{
lvcolumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH | LVCF_ORDER;
lvcolumn.fmt = LVCFMT_CENTER;
lvcolumn.pszText = rgtsz[i];
lvcolumn.iSubItem = i;
lvcolumn.iOrder = i;
if(i == 0)
lvcolumn.cx = 100;
else if(i == 1)
lvcolumn.cx = 100;
else if(i == 2)
lvcolumn.cx = 380; m_ReportList.InsertColumn(i, &lvcolumn);
// m_ReportList.Invalidate();
}
//////////////////这个地方往上是复制你的,其他的都是自动生成的 return TRUE; // return TRUE unless you set the focus to a control
}
{
// TODO: Add your control notification handler code here
m_ReportList.InsertItem(0, "xxxxxxxxxxx");
m_ReportList.SetItemText(0, 1, "xxxxxxxx");
m_ReportList.SetItemText(0, 2, "wwwwwwwwww"); UpdateData(FALSE);
}