WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

DisplayCurrentTime

This methods enables or disables the display of the time on a WS_LABEL widget.

Ole declaration

VARIANT_BOOL DisplayCurrentTimeById(SHORT usObjectId, BYTE bFormat);

VARIANT_BOOL DisplayCurrentTimeByName(LPCTSTR sObjectName, BYTE bFormat);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
bFormat
Specifies the new format used to display the current time.
Return Value

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

Remarks

The available formats are:

The available formats can be found on the WSTTimeFormats enumeration.

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
short iLabelId = 41;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LABEL, iLabelId, "", 0,0, 50, 50, "");
oWidget.DisplayCurrentTimeById(iLabelId, (short)WSTTimeFormats.WS_TIME_FORMAT_DD_MM_YYYY_HH_MM);
Visual Basic 6 (Full Example: LabelDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
wsWidget.DisplayCurrentTimeByName "labelTest8", WS_TIME_FORMAT_DD_MM_YYYY_HH_MM
wsWidget.SetBackGroundColorByName "labelTest8", 167, 100, 171
...
See also

ShowBorder | DisplayBatteryLifePercent | Enable

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