WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetState

Gets the current state of a WS_RADIO_BUTTON or WS_CHECK_BOX widget.

Ole declaration

BYTE GetStateByName(LPCTSTR sObjectName);

BYTE GetStateById(SHORT usObjectId);

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

On success, GetState returns one of the states described on SetState, GetState return 255 on failure. To get extended information, call WStError::GetLastErrorCode.

Remarks
Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
short iRadioButtonId = 22;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_RADIO_BUTTON, iRadioButtonId ,"", 0,0, 50, 50, "");
oWidget.SetStateById(iRadioButton, (short)WSTWidgetConstants.WS_STATE_CHECKED);
Visual Basic 6 (Full Example: RadioButtonDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
'Shows initial state of the groups
sState = wsWidget.GetStateByName("myRadioButton")
sCurrentState = "RBtn: " + sState

sState = wsWidget.GetStateByName("myRadioButton4")
sCurrentState = sCurrentState + " " + "RBtn4: " + sState
...
See also

SetState | SetGroupId | ModifyStyle

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