ListBox 得到行数和内容 vc++问题
答案:2 悬赏:20 手机版
解决时间 2021-04-06 10:05
- 提问者网友:鼻尖触碰
- 2021-04-06 05:07
ListBox 得到行数和内容 vc++问题
最佳答案
- 五星知识达人网友:痴妹与他
- 2021-04-06 06:32
使用C/C++,察看windowsx.h中以下宏的使用:
ListBox_GetCount
ListBox_GetTextLen
ListBox_GetText
使用MFC,察看CListBox中以下成员函数的使用:
GetCount
GetTextLen
GetText
ListBox_GetCount
ListBox_GetTextLen
ListBox_GetText
使用MFC,察看CListBox中以下成员函数的使用:
GetCount
GetTextLen
GetText
全部回答
- 1楼网友:佘樂
- 2021-04-06 07:54
首先通过ID获取该ListBox控件的CListBox指针list,然后
int Count = list->GetCount();获取字段个数
然后通过循环
CString str;
for(int index=0; index < Count; index++)
{
list->GetText(index, str);
AfxMessageBox(str);
}
这个例子就是将每个字段的内容以对话框形式输出
int Count = list->GetCount();获取字段个数
然后通过循环
CString str;
for(int index=0; index < Count; index++)
{
list->GetText(index, str);
AfxMessageBox(str);
}
这个例子就是将每个字段的内容以对话框形式输出
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯