Technical FAQs

Ask a Question

In Vijeo Citect , How to implement user input for and embedded Internet Explorer ActiveX control ?

Method one: Using Cicode function.

This example demonstrates the method of using Cicode Form Functions to create a popup

window for URL input for users.

Create a button according to the following configuration:


The “ANXXX” is the Object Name for the IE ActiveX control.

Open Cicode Editor:

FUNCTION myIE(STRING AN);

STRING URL

FormNew("URL Input Window",50,5,8);

FormInput(1,1,"Enter URL",URL,50);

FormRead(0);

OBJECT theIE = ObjectByName(AN);

_ObjectCallMethod(theIE, "navigate",URL );

END


At run time, when the button is clicked, a popup windows will appear which looks like:


Just type in the URL and hit the ENTER key, the IE should take you to the address. Click the button again if you want to navigate away from the current page.

Method 2: Use another ActiveX control object.

The following example illustrates the method of using “Microsoft Form 2.0 TextBox” for

user URL input.

In the graphic builder page, add a ActiveX control called “Microsoft Forms 2.0 TextBox”



Create a button with the following configuration:



Open Cicode Editor:

FUNCTION go(STRING AN)

STRING URL

URL = _ObjectGetProperty(ObjectByName("AN207"),"Text");

OBJECT theIE = ObjectByName("AN205");

_ObjectCallMethod(theIE, "navigate",URL );

END

NOTE: The “ANXXX” for this button and Cicode function is the Object Name for

“Microsoft Forms 2.0 TextBox”

At run time, type in the URL in the textbox and click go, the ENTER key does NOT

work in this case.

Other functions of the IE tool bar can be added in the same matter, after some graphic

design, your runtime window can look like this:


The Cicode function used to implement IE Tool Bar functions:

FUNCTION refresh(STRING AN)

_ObjectCallMethod(ObjectByName(AN), "Refresh");

END

///////////////////

FUNCTION webprint (STRING AN, INT PrintPrompt=1)

_ObjectCallMethod(ObjectByName(AN), "ExecWB", 6, PrintPrompt,

0, 0);

END

///////////////////

FUNCTION goback (STRING AN)

_ObjectCallMethod(ObjectByName(AN), "GoBack");

END

///////////////////

FUNCTION goforward (STRING AN)

_ObjectCallMethod(ObjectByName(AN), "GoForward");

END

///////////////////

FUNCTION gohome (STRING AN)

_ObjectCallMethod(ObjectByName(AN), "GoHome");

END

///////////////////

FUNCTION gosearch (STRING AN)

_ObjectCallMethod(ObjectByName(AN), "GoSearch");

END

///////////////////

FUNCTION gostop (STRING AN)

_ObjectCallMethod(ObjectByName(AN), "Stop");

END

 

Was this helpful?
What can we do to improve the information ?