|
|
WireLess Studio Widgets Developer's Guide |
|
This methods retrieves the currently selected item on a WS_LIST_CTRL (An item is a row) or a WS_MENU (An item is an option) widget.
SHORT GetSelectedItemByName(LPCTSTR sObjectName);
SHORT GetSelectedItemById(SHORT usObjectId);
On success, GetSelectedItem returns the zero based index of the selected item on a widget. If there's no items selected, GetSelectedItem returns -1. On error GetSelectedItem returns 32767. To get extended information, call WStError::GetLastErrorCode.
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.AddRowById(sListCtrlId, 0);
oWidget.AddRowById(sListCtrlId, 0);
if(oWidget.GetSelectedItemById(sListCtrlId) != -1)
{
oWidget.SetRowTextById(sListCtrlId, oWidget.GetSelectedItemById(sListCtrlId), 0, "44423");
}
Public wsWidget As New WStWidget
...
Case "newRowTextField"
sEventValue = wsForm.GetLastEventStrValue()
'Changes the text of the first column of a previously selected row
If wsWidget.GetSelectedItemByName("myListCtrl") <> -1 Then
wsWidget.SetRowTextByName "myListCtrl", wsWidget.GetSelectedItemByName("myListCtrl"), _
0, sEventValue
End If
...
AddColumn | ClearColumns | SetRowText | SetRowIcon | AddRow | ClearRows | ReadRowsFromFile | SetLoadMode | GetOption | ChangeMenuType | ClearOptions
WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference
| WireLess Studio by SofToGo S.A. | Visit our site www.softogo.com | Contact us help@softogo.com |