WireLess Studio Widgets Developer's Guide |
Changes the current font of a specific widget.
VARIANT_BOOL SetFontByName(LPCTSTR sObjectName, SHORT usFontId);
VARIANT_BOOL SetFontById(SHORT usObjectId, SHORT usFontId);
SetFont returns TRUE On success, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
When a WS_MENU widget behaves as a button menu (See ChangeMenuType), the modification of it's font also changes the font of the buttons that contains and it's title.
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); WStFactory oFactory = new WStFactory(); short sFontId = 4; oFactory.CreateCustomFont(sFontId, 21, true, false, false, "Arial",(short)WSFontAlignment.WS_CENTER); /* Using a previously created widget*/ short iButtonId = 20; oWidget.SetFontById(iButtonId, sFontId);
Public wsWidget As New WStWidget Public wsFactory As New WStFactory .. wsFactory.CreateCustomFont 3, 11, True, False, False, "Times New Roman", WS_LEFT wsFactory.CreateCustomFont 4, 16, False, True, True, "Tahoma", WS_RIGHT wsFactory.CreateCustomFont 5, 16, False, False, False, "Courier New", WS_CENTER ... Public Sub ChangeFont(iSelectedOption As Integer) Dim iFontId As Integer Select Case iSelectedOption Case 0 iFontId = 3 Case 1 iFontId = 4 Case 2 iFontId = 5 Case -1 iFontId = 3 End Select wsWidget.SetFontByName "button", iFontId wsWidget.SetFontByName "label", iFontId wsWidget.SetFontByName "checkBox", iFontId wsWidget.SetFontByName "radioButton", iFontId wsWidget.SetFontByName "progBar", iFontId wsWidget.SetFontByName "field", iFontId wsWidget.SetFontByName "listBox", iFontId wsWidget.SetFontByName "comboBox", iFontId End Sub
WStFactory::CreateCustomFont | SetText | GetText | SetTextColor | 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 |