如何在 c++ 中从列表视图中获取值
How to get value from listview in c++
我正在使用C++ Builder 2010。我想知道,如何从列表视图组件获取值?是否可以仅从第 2 列(例如(中获取值。 我找到了很多关于向列表视图添加值的信息,而不是阅读。
添加新项时,TListItems::Add()
方法返回一个TListItem*
。 要访问现有项目,您可以使用相同的TListItems
获取所需项目的TListItem*
,例如:
// get the desired item by its index in the list...
TListItem *Item = ListView1->Items->Item[index];
在任何给定项中,第一列由TListItem::Caption
属性表示,后续列由TListItem::SubItems
属性表示。 因此,就像使用SubItems
添加值一样,您可以使用SubItems
来读取值,例如:
String value = item->SubItems->Strings[0]; // 0 = 2nd column, 1 = 3rd column, etc...
相关文章:
- Qt - QVector 和模型视图 - 从列表视图获取自定义类的最佳方法是什么?
- 如何在 c++ 中从列表视图中获取值
- 如何从 gtkmm 树视图中获取所选行
- 无法在 OpenGL 中获取矩形的 3D 视图
- 如何从模型/视图中获取QImage POINTER
- 使用WPF获取DirectX视图/窗口
- 如何在选项卡视图中获取活动选项卡的文件名
- Android NDK-如何从TAP中获取坐标并将其显示在文本视图上
- 从eigen :: vectorxd获取矩阵视图/块而无需复制(共享内存)
- 如何获取避免滚动条的树视图控件的最小大小
- 如何将自动递增的主键的数据从 sql 服务器获取到我的数据网格视图
- QMatrix4x4 模型视图投影 OpenGL 无法获取要渲染的场景
- 从视图中获取QComboBox的信号
- Win32 c++:如何获取树视图控件中已检查项的数目
- 如何获取选定的树视图项文本
- Qt C++ 从表视图的选定行中获取数据
- 如何将用户输入的数据从数据网格视图获取到窗口窗体图
- 从boost::gil::视图获取原始指针
- Qt5:获取列表视图中点击项的值
- 如何从视图矩阵中获取当前摄像机位置