高分问一个简单问题, 懂 pb & vc 的朋友请进

jzhaohua 2002-09-12 12:09:54
1. listview 中加入一列
lv_1.AddColumn("文件", Left!, 800 )
把上面代码改成 vc, 怎么改?

2. listview 中加入一个 item
ListViewItem lvi_Entry
lvi_Entry.Label = 'aaa'
lvi_Entry.Data = ''
lvi_Entry.PictureIndex = 1
lvi_Entry.StatePictureIndex = 1
lv_1.AddItem( lvi_Entry )
这段代码怎么改?
...全文
31 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
killerdanny 2002-09-28
  • 打赏
  • 举报
回复
HTREEITEM hCountry,hCity,hDistrict;
TVINSERTSTRUCT tvInsert;

tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("中国");
hCountry = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCountry;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("北京");
hCity = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCountry;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("天津");
hCity = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCity;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("汉沽");
hDistrict = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCountry;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("上海");
hCity = m_tree1.InsertItem(&tvInsert);
m_tree1.Expand(hCountry,TVE_EXPAND);

运行结构就是
树根是“中国”,下面的接点有“北京”,“天津”,“上海”
天津下面有“汉沽”
鼠标双击展开接点。

//你应该去VC论坛问问,不过也不难!
killerdanny 2002-09-28
  • 打赏
  • 举报
回复
HTREEITEM hCountry,hCity,hDistrict;
TVINSERTSTRUCT tvInsert;

tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("中国");
hCountry = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCountry;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("北京");
hCity = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCountry;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("天津");
hCity = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCity;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("汉沽");
hDistrict = m_tree1.InsertItem(&tvInsert);

tvInsert.hParent = hCountry;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("上海");
hCity = m_tree1.InsertItem(&tvInsert);
m_tree1.Expand(hCountry,TVE_EXPAND);

//TREEVIEW代码。LISTVIEW类似!
都是先添结构,然后插入。
hzhxxx 2002-09-28
  • 打赏
  • 举报
回复
VC 还不一样有 listview 类!

都是 comctl32.dll的后代!
diliver 2002-09-28
  • 打赏
  • 举报
回复
-------------------------------
_,..,_ (, )
.,' `,./
.' :`.----.': `,
: : ^ ^ : ;
: : 6 6 : ;
: : : ;
: : __ : ;
: `:'.--.`:' ;
`. : o o : .'
jgs : `----' :
: . :'`: . :
--------------------------------------------
猪猪
shahand 2002-09-12
  • 打赏
  • 举报
回复
查 一下msdn不就行了?

1,077

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧