![]() |
Using VBScript with Objects![]() ![]() ![]() ![]() ![]()
Using Objects
Whether you use an ActiveX control (formerly called an OLE control) or a Java' object, Microsoft Visual Basic Scripting Edition and Microsoft Internet Explorer handle it the same way. If you're using Internet Explorer and have installed the Label control, you can see the page produced by the following code. You include an object using the <OBJECT> tags and set its initial property values using <PARAM> tags. If you're a Visual Basic programmer, you'll recognize that using the <PARAM> tags is just like setting initial properties for a control on a form. For example, the following set of <OBJECT> and <PARAM> tags adds the ActiveX Label control to a page: <OBJECT A6C7 OOAAOOA47DD2" <PARAM NAME="Angle" VALUE="90"> <PARAM NAME="FontSize" VALUE="20"> <PARAM NAME="FontBold" VALUE="1"> <PARAM NAME-"FrColor" VALUE="0"> <OBJECT> You can get properties, set properties, and invoke methods just as with any of the form controls. The following code, for example, includes <FORM> controls you can use to manipulate two properties of the Label control: <FORM NAME ="LabelControls"> <INPUT TYPE="TEXT" NAME="txtNewText" SIZE=25> <INPUT TYPE="BUTTON" NAME="cmdChangeIt" VALUE="Change Text"> <INPUT TYPE="BUTTON" NAME="cmdRotate" VALUE="Rotate Label"> </FORM> With the form defined, an event procedure for the cmdChangelt button changes the label text: <SCRIPT LANGUAGE="VBScript"> <!-- The code qualifies references to controls and' values inside the forms just as in the Simple Validation example.
|
|
Domain NamesVBSCRIPT VBScript Code VBScript Data Types VBScript Variables constants VBScript Operators Using Conditional Statements Looping Statements in VBScript VBScript Procedures VBScript Coding Conventions VBScript and Forms
Using VBScript with ObjectsWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |