导航
  • 主页
  • API 调用
  • 基础类
  • 控件与界面
  • 数据库相关
  • DataWindow
  • 项目管理
  • Web 应用
  • 脚本语言

下拉列表值怎么写?

WoJoJo 2008-01-22 10:10:57
下拉列表中的值怎么写进去啊?
我是菜鸟,望高手们帮忙!!
...全文
79 点赞 收藏 7
写回复
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
worldly_wind 2008-01-22
看属性-Items就知道了
回复
青锋-SS 2008-01-22
是数据窗口的下拉列表还是诸如DropDownListBox等的下拉列表?
回复
dawugui 2008-01-22
This example adds the item Edit File to the ListBox lb_Actions:

integer rownbr

string s

s = "Edit File"

rownbr = lb_Actions.AddItem(s)

If lb_Actions contains Add and Run and the Sorted property is FALSE, the statement above returns 3 (because Edit File becomes the third and last item). If the Sorted property is TRUE, the statement above returns 2 (because Edit File becomes the second item after the list is sorted alphabetically).
回复
dawugui 2008-01-22
Description

Adds a new item to the list of values in a list box.

Controls

ListBox and DropDownListBox controls

Syntax

listboxname.AddItem ( item )

Argument Description
listboxname The name of the ListBox or DropDownListBox in which you want to add an item
item A string whose value is the text of the item you want to add
Return value

Integer. Returns the position of the new item. If the list is sorted, the position returned is the position of the item after the list is sorted. Returns -1 if it fails. If any argument's value is NULL, AddItem returns NULL.

Usage

If the ListBox already contains items, AddItem adds the new item to the end of the list. If the list is sorted (its Sorted property is TRUE), PowerBuilder re-sorts the list after the item is added.
A list can have duplicate items. Items in the list are tracked by their position in the list, not their text.
AddItem and InsertItem do not update the Items property array. You can use FindItem to find items added during execution.


Adding many items to a list with a horizontal scrollbar If a ListBox or the ListBox portion of a DropDownListBox will have a large number of items and you want to display an HScrollBar, call the SetRedraw function to turn Redraw off, add the items, call SetRedraw again to set Redraw on, and then set the HScrollBar property to TRUE. Otherwise, it may take longer than expected to add the items.
回复
dawugui 2008-01-22
lb_1.Additem
回复
leio 2008-01-22
PB联机帮助查Additem

This example adds the item Edit File to the ListBox lb_Actions:

integer rownbr

string s

s = "Edit File"

rownbr = lb_Actions.AddItem(s)

回复
WoJoJo 2008-01-22
是不是应该用游标??
回复
发动态
发帖子
PowerBuilder
创建于2007-09-28

809

社区成员

PowerBuilder 相关问题讨论
申请成为版主
社区公告
暂无公告