| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1098 人关注过本帖, 1 人收藏
标题:[讨论]TreeView增强功能!
只看楼主 加入收藏
junxi1
Rank: 1
等 级:新手上路
威 望:1
帖 子:213
专家分:0
注 册:2007-9-17
收藏
得分:0 

直接这样写就行了。
Dim i As Long
If List1.ListCount > 0 Then
For i = 0 To List1.ListCount - 1
If Text1.Text = Left(List1.List(i), Len(Text1.Text)) Then
List1.ListIndex = i
Exit For
End If
Next
End If


foreach( in ){ }
2007-09-28 16:57
随风逐流
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:passerby
等 级:版主
威 望:8
帖 子:4054
专家分:271
注 册:2007-6-13
收藏
得分:0 
以下是引用junxi1在2007-9-28 16:57:42的发言:

直接这样写就行了。
Dim i As Long
If List1.ListCount > 0 Then
For i = 0 To List1.ListCount - 1
If Text1.Text = Left(List1.List(i), Len(Text1.Text)) Then
List1.ListIndex = i
Exit For
End If
Next
End If

我前面都写出来了.
如果Text1.Text 的长度大于List1.List(i)长度,那程序就报错.


[url=http://www./html/6/6694/]极道金丹[/url][url=http://www./html/2/2849/]九阴九阳[/url][url=http://www./html/2/2596/]凡人修仙传[/url]
2007-09-28 17:07
快速回复:[讨论]TreeView增强功能!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.010927 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved