WireLess Studio Widgets Developer's Guide |
Sets the background color for a specific widget.
VARIANT_BOOL SetBackgroundColorByName(LPCTSTR sObjectName, SHORT usRed, SHORT usGreen, SHORT usBlue);
VARIANT_BOOL SetBackGroundColorById(SHORT usObjectId, SHORT usRed, SHORT usGreen, SHORT usBlue);
On success, SetBackGroundColor returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The red, green and blue colors must be in the range 0-255, if the colors are not in this range each value will be truncated.
When used on a WS_MENU (which type is WS_BUTTON_MENU_TYPE), the background color of the buttons is modified, not the menu's background color. To change the menu's background color call WStForm::SetBackgroundColor instead
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); WStFactory oFactory = new WStFactory(); short iFieldId = 33; oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_FIELD, iFieldId, "", 0,0, 50, 50, "123"); wsWidget.SetBackGroundColorById(iFieldId, 206, 219, 247);
Public wsWidget As New WStWidget ... 'Button Test 2: White background, blue font wsWidget.SetTextColorByName "buttonTest2", 0, 0, 160 wsWidget.SetBackGroundColorByName "buttonTest2", 255, 255, 255 wsWidget.SetIconByName "buttonTest2", 2 ...
SetTextColor | SetBarColor | SetText | GetText | WStForm::SetBackgroundColor
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 |