WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetSelectedVisibleItem

Overloaded version of SetSelectedItem() that works only on a WS_LIST_CTRL widget

Ole declaration

VARIANT_BOOL SetSelectedVisibleItemById(SHORT usObjectId, SHORT usItemIndex, VARIANT_BOOL bVisible);

VARIANT_BOOL SetSelectedVisibleItemByName(LPCTSTR sObjectName, SHORT usItemIndex, VARIANT_BOOL bVisible);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usItemIndex
The index of the item that will be selected.
bVisible
If TRUE the widget will ensure that the item is visible after the selection changes
Return Value

On success, SetSelectedVisibleItem returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
short sListCtrlId= 4;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, "");
oWidget.AddColumById(sListCtrlId, 40, "Product Id");
oWidget.AddRowById(sListCtrlId, 0);
oWidget.SetRowTextById(sListCtrlId, 0, 0, "33413");
oWidget.SetSelectedVisibleItemById(sListCtrlId, 0, TRUE);
See also

SetSelectedItem | DeleteRow | SetRowIcon | AddRow | ClearRows | AddColumn | ClearColumns | GetSelectedItem | ReadRowsFromFile | GetItemCount | SetLoadMode

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference