小弟在学treeview控件的使用方法
照着书上代码先练习了下~
TreeViewItem ltvi_root //TreeeViewItem 对象
TreeViewItem ltvi_node
integer i_index
long l_lev0
long l_lev1
string str_list
string str_root = '中国'
string str_area[]={"北京市","天津市","上海市","河南省"}
ltvi_root.PictureIndex = 1
ltvi_root.SelectedPictureIndex = 2
ltvi_node.StatePictureIndex = 1
// 根
ltvi_root.label = str_root
l_lev0 = this.InsertItemLast(0, ltvi_root)
//节点
For i_index = 1 To 4
ltvi_node.label = str_area[i_index]
l_lev1 = this.InsertItemLast(l_lev0, ltvi_node)
Next
为什么根节点,子节点显示的都是乱码呢??、整个一个树形表 都是乱码的~
------解决方案--------------------
刚才我试了一下,你的代码没有问题。
可以显示出树。
可能是你的字符编码有问题。。。
你的代码的最后一行最好再加上这样一句:
expanditem(1)
------解决方案--------------------
乱码。。。
你再换个text控件看看是不是也乱码
------解决方案--------------------
把字体设置成宋体试试.....
------解决方案--------------------
楼上正解