WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetSelectedColumn

This method retrieves the currently selected column on a WS_LIST_CTRL

Ole declaration

SHORT GetSelectedColumnByName(LPCTSTR sObjectName);

SHORT GetSelectedColumnById(SHORT usObjectId);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
Return Value

On success, GetSelectedColumn returns the zero based index of  the selected column on a widget. If there's no column selected, GetSelectedColumn returns -1. On error GetSelectedItem returns 32767. To get extended information, call WStError::GetLastErrorCode.

Remarks
Example
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas.txt)
Public wsWidget As New WStWidget
Case "myListCtrl"
	If wsWidget.GetLastClickEventTypeByName("myListCtrl") = WS_CLICK_EVENT_ON_ITEM Then
		iSelectedRow = wsWidget.GetSelectedItemByName("myListCtrl")
		sIntVal = iSelectedRow
		sEventValue = "Row: " + sIntVal + " Str: " + _
		wsWidget.GetRowTextByName("myListCtrl", iSelectedRow, 0)
	ElseIf wsWidget.GetLastClickEventTypeByName("myListCtrl") = WS_CLICK_EVENT_ON_HEADER Then
		sIntVal = wsWidget.GetSelectedColumnByName("myListCtrl")
		sEventValue = "Column: " + sIntVal
	End If
See also

GetSelectedItem | GetOption

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