WireLess Studio Widgets Developer's Guide |
This method attaches a widget to a form. When a widget is attached to a form, this form is called the widget's "parent form".
VARIANT_BOOL AddObjectByName(LPCTSTR sFormName, LPCTSTR sObjectName);
VARIANT_BOOL AddObjectById(SHORT usFormId, SHORT usObjectId);
On success, AddObject returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
A widget can be attached to more than one form.
using WirelessStudioOleWidgets; WStFactory oFactory = new WStFactory(); WStForm oForm = new WStForm (); short formId = 10; short lineId = 15; oFactory.CreateFormById(formId); oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LINE, lineId , "MyLine", 15, 15, 30, 30, ""); oForm.AddObjectBydId(formId, lineId);
Public wsForm As New WStForm Public wsFactory As New WStFactory ... 'Form creation and customization wsFactory.CreateFormByName "myForm" wsForm.SetCoordTypeByName "myForm", WS_FORM_CT_BYPERCENTAGE ... wsFactory.CreateWidget WS_BUTTON, 0, "moveUpBtn", 47, 63, 6, 5, "^" wsFactory.CreateWidget WS_BUTTON, 0, "moveDownBtn", 53, 63, 6, 5, "v" ... 'Widgets Attachment wsForm.AddObjectByName "myForm", "moveUpBtn" wsForm.AddObjectByName "myForm", "moveDownBtn" ...
WStFactory::CreateWidget | WStFactory::CloneObject | WStFactory::CreateForm
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 |