Share via


Visual Basic Concepts

What is a DHTML Application?

A DHTML application is a group of HTML pages that work together to perform a business process. You write Visual Basic code to handle events that occur when these pages are viewed in the browser. You can respond to events that occur on any element on the page — from clicking a button to loading an image to passing the mouse over a certain part of the page.

Most of the processing associated with a DHTML application occurs on the client computer, although the application can make calls to the server. However, performing the majority of processing on the client (in this case, the browser) allows your applications to respond quickly to user actions without making time-consuming trips to the server. In addition, corporations can lower the cost of training and support associated with their applications by presenting commonly used information and applications through the browser.

The end user views a DHTML application with Internet Explorer 4.0 or later. DHTML applications are designed to work most optimally on intranets. An intranet is a Web site or series of Web sites that belong to an organization and can be accessed only by the organization’s members. Many corporations use an intranet, rather than the Internet, to offer their employees easy access to corporate information, such as customer order information, sales data, or performance figures, while preventing outside access to that data.

In addition to writing Visual Basic code to hook up to a Web page, you can use a special designer in Visual Basic to create Web pages that act as the user interface of your application. You can also pull an existing Web page into Visual Basic and modify it. This allows you to tailor the process to your preferences — if you are familiar with HTML and want to create your own pages you can do so using the DHTML Page designer. If not, you can have an experienced Web developer create the pages and simply add them to your application.

Note   See "Introduction to Internet Applications" for more information on Internet technologies in general, including HTTP, the Internet development environment, and models of Web browser and Web server interaction.

Important   You must use Internet Explorer version 4.01 or later if you want to create or run a DHTML application in Visual Basic.

Web Pages vs. Forms

DHTML applications are structured differently than forms-based Visual Basic applications. In a DHTML application, the user interface consists of a series of HTML pages rather than forms. An HTML page is like a form in that it contains all the visual elements that make up your application's user interface. You can place some of the same items into a page as you do a form, including text, buttons, check boxes, and radio buttons.

An HTML page is stored in an .htm file that is analogous to a .frm file, in that it is used to render and display the form to the end user. You can create these pages yourself, or a Web designer or a developer can create the pages and you can then link the finished pages into your project.

The following table sums up the differences between forms-based applications and Web-based applications:

  Forms-based application Web-based
application
User interface Visual Basic forms HTML pages
UI elements (for example, text boxes, buttons, images) controls elements
File format .frm files .htm or .html files, or generated from Visual Basic code
Creator developer Web designer or developer
Run time Visual Basic run-time DLL, msvbvm60.dll Web browser or Web browser control, with msvbvm60.dll

Note   You cannot write code in a form, message box, or other object that references HTML elements on the page. Page elements are only accessible within the page itself.

Structure of DHTML Applications

DHTML applications are made up of the following pieces:

  • One or more HTML pages.

  • Visual Basic code that handles the events generated from the HTML pages.

  • A run-time component that hosts the page in the Web browser or Web browser control.

  • A project DLL that contains your Visual Basic code and is accessed by the run-time component, generated automatically when you debug or compile.

There is a one-to-one relationship between the designers and the HTML pages in your project. For each page in your application, there is a page designer.