WEB-BROWSER2 Control

Attention: WEB-BROWSER2 is selected by default in our regular installer, and this enables you to use the WEB-BROWSER2 control in your applications. If you are planning on using Thin Client, then you must install the Thin Client from a "Full" installer to ensure that all required files are available. See Installing the ACUCOBOL-GT Thin Client for details.
Note: This topic documents use of the WEB-BROWSER2 control. Where possible, the WEB-BROWSER2 control is implemented the same as the now deprecated WEB-BROWSER control. To compare, see the documentation for Web Browser Control - deprecated.

The ACUCOBOL-GT® Development System includes an Internet-related graphical control called WEB-BROWSER2. This control broadens the usefulness and scope of your COBOL programs (this control is designed for Windows users only). For instance, the WEB-BROWSER2 control lets you:

ACUCOBOL-GT's WEB-BROWSER2 control is used just as any other graphical control in ACUCOBOL-GT is used, except that it opens a resource such as an HTML page. When you include the WEB-BROWSER2 control in your source code, your COBOL UI displays a browser and connects to the resource you specified.

For example to display our Web page on the user's machine, you might create a WEB-BROWSER2 control identified by the name BROWSER-1, then add the following lines to a Screen Section item:

03  BROWSER-1 WEB-BROWSER2, VALUE "www.microfocus.com" 
    COLUMN 5, LINE 5, SIZE 60, LINES 20.

or add the following Procedure Division code:

DISPLAY WEB-BROWSER2, VALUE "www.microfocus.com"
 COLUMN 5, LINE 5, SIZE 60, LINES 20.

As with any ACUCOBOL-GT control, you can add the WEB-BROWSER2 control to user interface screens using the AcuBench® Screen Designer. The control can be found on the screen design control palette along with the other controls. Click the control, fill in its value clause, and the Screen Painter will show you what the screen will look like to the user.

Your WEB-BROWSER2 control can be as simple or involved as you like. In its simplest form, the WEB-BROWSER2 control is activated in a single DISPLAY statement. You can specify the size and other standard properties. You can also inquire and modify Special properties and Other properties from your COBOL program.

Note: If you are using the Windows 10 operating system, we recommend that you install the WebView2 Runtime if you have applications that use the WEB-BROWSER2 control.

For information on the methods, properties, events, and event properties of the WEB-BROWSER2 control, see User Interface Programming.