Click here to Skip to main content
15,881,588 members
Articles / Web Development / ASP.NET
Article

Use an Internet Explorer Window to Display Information from your VB Scripts

Rate me:
Please Sign up or sign in to vote.
4.10/5 (4 votes)
17 Aug 2007CPOL1 min read 38.9K   464   25   1
This class allows you to display all types of static and dynamic information gathered in a VB Script using an Internet Explorer Window.

Introduction

Time and time again for my job I needed to be able to display dynamic/updating information about our PACS system. Using a VB Script and this class, I was able to create the example below. This example would gather information from our database every 15 seconds and then update the Window. Since then I have found so many other uses for this class. So I thought I would share it with everyone.

Screenshot - Sample.jpg

Background

This article explains how to use the IEDisplay class, and does not go into the functioning of the class code itself.

Using the code

First you need to copy the contents of the class located in the file IEDisplay_Class_Only.txt and paste it in your VB Script.

The next thing is to create an instance of the class in your VB Script:

VBScript
// 'Create our IE window to output info from our script to
Dim ScriptUpdateWindow
Set ScriptUpdateWindow = new IEDisplay

Then set the four properties BEFORE calling the .Show method:

VBScript
ScriptUpdateWindow.WindowTitle = "Jake's IE Display Class" 'Default is blank
ScriptUpdateWindow.InitialText = "Loading Please wait..." 'Default is blank
ScriptUpdateWindow.NumberOfLabels = 2 'default of 1, max of 5
ScriptUpdateWindow.Horizontal_Vertical_Labels = _
                            "vertical" 'default of "horizontal"

Now call the .show method and the Window is available to display information to:

VBScript
'Call the .show method to make the IE window appear
ScriptUpdateWindow.Show()

There are two ways to add data to the IE window. Using the .SetText or .AppendText methods.

VBScript
ScriptUpdateWindow.SetText "StringText Set To Display In Label",_
                                1 '(The label Number)
ScriptUpdateWindow.AppendText "StringText Set To Append In Label" + _
                                IP,1 '(The label Number)

Points of Interest

See the VBScript examples provided with the zip file. These examples show all of the available methods of the class and how to use all the features. The comments through the code should answer any questions on how to use this properly.

History

  • Version 1.0: Submitted on 17-Aug-2007

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 4 Pin
emacs7323-Sep-10 23:05
emacs7323-Sep-10 23:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.