WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

EnableFlatStyle

Removes the 3D border of a WS_BUTTON widget and the buttons contained by a WS_MENU widget when it's type is WS_BUTTON_MENU_TYPE.

Ole declaration

VARIANT_BOOL EnableFlatStyleByName(LPCTSTR sObjectName, VARIANT_BOOL bEnable);

VARIANT_BOOL EnableFlatStyleById(SHORT usObjectId, VARIANT_BOOL bEnable);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
bEnable
Enables or disables the flat style.
Return Value

EnableFlatStyle returns TRUE on success, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
short sButtonId = 4, sIconId = 33;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_BUTTON, sButtonId, "", 0,0, 50, 50, "");
oWidget.EnableFlatStyleById(iButtonId, TRUE);
Visual Basic 6 (Full Example: ButtonDemoModule.bas.txt)
Public wsWidget As New WStWidget
Public wsFactory As New WStFactory
..
'Button Test 1: Blue background, Blue font
wsWidget.SetTextColorByName "buttonTest1", 0, 0, 119
wsWidget.SetBackGroundColorByName "buttonTest1", 184, 202, 241
wsWidget.SetIconByName "buttonTest1", 1
wsWidget.ShowBorderByName "buttonTest1", False
wsWidget.EnableFlatStyleByName "buttonTest1", True
...
See also

EnableSubmitMode | SetIcon | ShowBorder

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