如題,查了好久,都是.NET的listbox的用法,請教pb中怎么用代碼取消listbox中已經選中的選項,就是去掉那個藍條
----如果盡快解決還可以加分
uj5u.com熱心網友回復:
幫你找了半天Description
Sets the highlighted state of an item in a list box. SetState is only applicable to a list box control whose MultiSelect property is set to true.
Controls
ListBox and PictureListBox controls
Syntax
listboxname.SetState ( index, state )
Argument Description
listboxname The name of the ListBox or PictureListBox in which you want to set the state (highlighted or not highlighted) for an item. The MultiSelect property for the control must be set to true.
index The number of the item for which you want to set the state. Specify 0 to set the state of all the items in the ListBox.
state A boolean value that determines the state of the item:?TRUE - Selected?FALSE - Not selected
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, SetState returns null.
Usage
When the MultiSelect property for the control is false, use SelectItem, instead of SetState, to select one item at a time.
uj5u.com熱心網友回復:
listboxname.SetState ( index, state )這個應該可以滿足你
如果你未設定多選,這個有可能不好用(未測驗),你可以考慮把選中項洗掉然后再新增。
uj5u.com熱心網友回復:
版主就是熱心啊,同學轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/52524.html
標籤:腳本語言
