| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 6765 人关注过本帖
标题:[求助]TextBox控件的SelStart, SelLength属性的意思分别是什么啊
只看楼主 加入收藏
寻找
Rank: 2
等 级:论坛游民
帖 子:132
专家分:19
注 册:2007-3-2
结帖率:100%
收藏
 问题点数:0 回复次数:4 
[求助]TextBox控件的SelStart, SelLength属性的意思分别是什么啊
请问各位,TextBox控件的SelStart, SelLength属性的意思分别是什么啊?
我查手册,查不到这个两个属性的意思!
请知道的朋友帮忙解释一下好吗?谢谢!
搜索更多相关主题的帖子: TextBox控件 SelLength SelStart 属性 意思 
2007-07-23 21:24
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 

这个是MSDN里的:

SelLength, SelStart, SelText
The SelLength property returns or sets the number of characters selected.

The SelStart property returns or sets the starting point of text selected; indicates the position of the insertion point if no text is selected.

The SelText property returns or sets the string containing the currently selected text; consists of a zero-length string ("") if no characters are selected.

Note These properties are not available at design time.

Syntax
object.SelLength [= number]

object.SelStart [= index]

object.SelText [= value]

The parts of the SelLength, SelStart, and SelText property syntaxes are described in the following table.

Part Description
object An object expression that evaluates to an object.
number A numeric expression specifying the number of characters selected. For SelLength and SelStart, the valid range of settings is 0 to text length — the total number of characters in the edit area of a ComboBox or TextBox control.
index A numeric expression specifying the starting point of the selected text, as described in Settings.
value A string expression containing the selected text.


Remarks
Use these properties for tasks such as setting the insertion point, establishing an insertion range, selecting substrings in a control, or clearing text. Used in conjunction with the Clipboard object, these properties are useful for copy, cut, and paste operations.

When working with these properties, remember that:

Setting SelLength less than 0 causes a run-time error.
Setting SelStart greater than the text length sets the property to the existing text length; changing SelStart changes the selection to an insertion point and sets SelLength to 0.
Setting SelText to a new value sets SelLength to 0 and replaces the selected text with the new string.


2007-07-24 08:40
Joforn
Rank: 6Rank: 6
等 级:贵宾
威 望:23
帖 子:1242
专家分:122
注 册:2007-1-2
收藏
得分:0 

给你段中文的:
SelLength 返回或设置 Slider 控件中选择出的范围长度。


SelStart 返回或设置 Slider 控件中选择出的范围起点。
语法

object.SelLength [= value]

object.SelStart [= value]

SelLength 和 SelStart 属性的语法包含下面部分:

部分 描述
object 对象表达式,其值是 Slider 控件。
value Min 和 Max 属性中的数值。


说明

SelLength 和 SelStart 属性一起使用,可以在 Slider 控件上选择某一范围内的连续数值。于是,Slider 控件还具有进一步的优势,它可以在直观上模拟可能的取值范围。

SelLength 属性不能小于 0,SelLength 与 SelStart 之和不能大于 Max 属性。


VB QQ群:47715789
2007-07-24 10:03
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
注意:对中文支持不好。

快上课了……
2007-07-24 10:18
寻找
Rank: 2
等 级:论坛游民
帖 子:132
专家分:19
注 册:2007-3-2
收藏
得分:0 
以下是引用Joforn在2007-7-24 10:03:10的发言:

给你段中文的:
SelLength 返回或设置 Slider 控件中选择出的范围长度。


SelStart 返回或设置 Slider 控件中选择出的范围起点。
语法

object.SelLength [= value]

object.SelStart [= value]

SelLength 和 SelStart 属性的语法包含下面部分:

部分 描述
object 对象表达式,其值是 Slider 控件。
value Min 和 Max 属性中的数值。


说明

SelLength 和 SelStart 属性一起使用,可以在 Slider 控件上选择某一范围内的连续数值。于是,Slider 控件还具有进一步的优势,它可以在直观上模拟可能的取值范围。

SelLength 属性不能小于 0,SelLength 与 SelStart 之和不能大于 Max 属性。

谢谢楼上的朋友!昨晚停电,所以没法上来看!充心感谢!

2007-07-24 13:30
快速回复:[求助]TextBox控件的SelStart, SelLength属性的意思分别是什么啊
数据加载中...
 
   



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

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