listbox
来源:互联网 发布:c语言调用函数被跳过 编辑:程序博客网 时间:2024/04/25 16:53
listbox
ListBox作为vb的一个控件
中文名称列表框
可以通过vb的代码添加、修改列表框的内容
列表框可以在编程中显示各种需要的数值
方法:
Sub AddItem(Item As String, [Index])
VB.ListBox 的成员
添加一项到 Listbox 控件。
参数:
Item:所要添加的字符串
Index:可选,将字符串插入在第Index项后面
例:
Dim i%
For i = 1 To 10
List1.AddItem CStr(i)
Next
List1.AddItem "你好", 5
效果:
1
2
3
4
5
你好
6
7
8
9
10
Sub Clear()
VB.ListBox 的成员
清除列表所有项。
参数:无
例:在AddItem的例子后添加
List1.Clear
这样你的列表框中的内容就都清除了
Sub RemoveItem(Index As Integer)
VB.ListBox 的成员
从一个 ListBox 控件中删除一项。
参数:
Index:你要删除的那项的索引
例:在AddItem的例子后添加
List1.RemoveItem 3
效果:
1
2
3
5
你好
6
7
8
9
10
属性:
Property Columns As Integer
VB.ListBox 的成员
返回/设置一个值,决定列表框为是在一列中(值为0时)垂直滚动,还是多个列中(值大于0时)水平滚动。
Property List(Integer) As String
VB.ListBox 的成员
返回/设置控件的列表部分中包含的项。
Property ListCount As Integer
只读
VB.ListBox 的成员
返回控件的列表部分中的项目数。
Property ListIndex As Integer
VB.ListBox 的成员
返回/设置该控件中当前选定项目的索引值。
Property MultiSelect As Integer
只读
VB.ListBox 的成员
返回/设置一个值,决定用户是否可以在一个控件中做多重选择。
Property NewIndex As Integer
只读
VB.ListBox 的成员
返回添加到控件中的最近一个项目的索引。
Property SelCount As Integer
只读
VB.ListBox 的成员
返回 ListBox 控件选定的项目数。
Property Selected(Integer) As Boolean
VB.ListBox 的成员
返回/设置控件中项目的选定状态。
Property Sorted As Boolean
只读
VB.ListBox 的成员
指出控件元素是否自动按字母顺序排序。
Property Style As Integer
只读
VB.ListBox 的成员
返回/设置一个值,决定是否将复选框显示在 ListBox 控件中。
Property Text As String
VB.ListBox 的成员
返回当前选中项的文本。
Property TopIndex As Integer
VB.ListBox 的成员
返回/设置在控件中显示在最顶端的项目。
-------------------------------------------------------------------
ListBox 和 ComboBox 为用户提供了选择。按照缺省规定,选项以垂直单列方式显示,也可以设置成多列方式。如果项目数量超过 ComboBox 或 ListBox 所能显示的数目,ScrollBar 自动出现在控件上。于是用户可以在列表中上下左右滚动。
ComboBox 兼有 TextBox 和 ListBox 两者的功能。该控件允许用户通过键入文本或选择列表中的项目来进行选择。
与其它含有单值的控件相反,例如 Label 的 Caption 属性或 TextBox 的 text 属性,ListBox 和 ComboBox 含有多个值或值的集合。在运行时用内置的方法增加、删除及保持集合中的值。要将几条项目添加到名为 List1 的 ListBox 中,其代码如下:
List1.AddItem "Paris"
List1.AddItem "New York"
List1.AddItem "San Francisco"
ListBox 和 ComboBox 是在有限空间为用户提供大量选项的有效方法。
详细信息 关于 ListBox 和 ComboBox 控件的详细信息,请参阅“使用 Visual Basic 的标准控件”。
中文名称列表框
可以通过vb的代码添加、修改列表框的内容
列表框可以在编程中显示各种需要的数值
方法:
Sub AddItem(Item As String, [Index])
VB.ListBox 的成员
添加一项到 Listbox 控件。
参数:
Item:所要添加的字符串
Index:可选,将字符串插入在第Index项后面
例:
Dim i%
For i = 1 To 10
List1.AddItem CStr(i)
Next
List1.AddItem "你好", 5
效果:
1
2
3
4
5
你好
6
7
8
9
10
Sub Clear()
VB.ListBox 的成员
清除列表所有项。
参数:无
例:在AddItem的例子后添加
List1.Clear
这样你的列表框中的内容就都清除了
Sub RemoveItem(Index As Integer)
VB.ListBox 的成员
从一个 ListBox 控件中删除一项。
参数:
Index:你要删除的那项的索引
例:在AddItem的例子后添加
List1.RemoveItem 3
效果:
1
2
3
5
你好
6
7
8
9
10
属性:
Property Columns As Integer
VB.ListBox 的成员
返回/设置一个值,决定列表框为是在一列中(值为0时)垂直滚动,还是多个列中(值大于0时)水平滚动。
Property List(Integer) As String
VB.ListBox 的成员
返回/设置控件的列表部分中包含的项。
Property ListCount As Integer
只读
VB.ListBox 的成员
返回控件的列表部分中的项目数。
Property ListIndex As Integer
VB.ListBox 的成员
返回/设置该控件中当前选定项目的索引值。
Property MultiSelect As Integer
只读
VB.ListBox 的成员
返回/设置一个值,决定用户是否可以在一个控件中做多重选择。
Property NewIndex As Integer
只读
VB.ListBox 的成员
返回添加到控件中的最近一个项目的索引。
Property SelCount As Integer
只读
VB.ListBox 的成员
返回 ListBox 控件选定的项目数。
Property Selected(Integer) As Boolean
VB.ListBox 的成员
返回/设置控件中项目的选定状态。
Property Sorted As Boolean
只读
VB.ListBox 的成员
指出控件元素是否自动按字母顺序排序。
Property Style As Integer
只读
VB.ListBox 的成员
返回/设置一个值,决定是否将复选框显示在 ListBox 控件中。
Property Text As String
VB.ListBox 的成员
返回当前选中项的文本。
Property TopIndex As Integer
VB.ListBox 的成员
返回/设置在控件中显示在最顶端的项目。
-------------------------------------------------------------------
ListBox 和 ComboBox 为用户提供了选择。按照缺省规定,选项以垂直单列方式显示,也可以设置成多列方式。如果项目数量超过 ComboBox 或 ListBox 所能显示的数目,ScrollBar 自动出现在控件上。于是用户可以在列表中上下左右滚动。
ComboBox 兼有 TextBox 和 ListBox 两者的功能。该控件允许用户通过键入文本或选择列表中的项目来进行选择。
与其它含有单值的控件相反,例如 Label 的 Caption 属性或 TextBox 的 text 属性,ListBox 和 ComboBox 含有多个值或值的集合。在运行时用内置的方法增加、删除及保持集合中的值。要将几条项目添加到名为 List1 的 ListBox 中,其代码如下:
List1.AddItem "Paris"
List1.AddItem "New York"
List1.AddItem "San Francisco"
ListBox 和 ComboBox 是在有限空间为用户提供大量选项的有效方法。
详细信息 关于 ListBox 和 ComboBox 控件的详细信息,请参阅“使用 Visual Basic 的标准控件”。
- listbox
- listbox
- ListBox
- listbox
- Listbox
- listbox
- ListBox
- LISTBOX
- ListBox
- listbox
- Listbox
- listbox
- ListBox
- ListBox
- ListBox
- listbox
- listbox
- listbox
- 函数调用约定
- 歌词6-在路上
- 3.JBoss如何配置从数据库里读取登录用户的验证信息
- Java数据库连接、操作以及应用规范编码举例
- java RMI 原理与编程(分布式对象1)
- listbox
- 学习Asp.Net经常会用到的函数集
- 模板的分离编译
- The Elements of Java Style——前言
- 篡改村长的小诗
- 基于GridView日程管理
- asp.net打印DataGrid数据和打印网页
- Format number in Javascript
- const与extren大全