Share via


Visual Basic Concepts

Using Existing HTML Pages in the Page Designer

You can use existing HTML pages for your application’s user interface rather than designing the pages in Visual Basic. This is useful if you prefer not to design the user interface yourself, or if you want to design it using another tool and then bring it into your Visual Basic application. Using an external program can give you access to the source HTML, rather than just a visual representation of the page, and may give you more advanced functionality when you design the page. You can design your interface in any HTML editor, word processor, or text program.

To use an existing HTML page, you reference it as the source for the page by setting the SourceFile property. Visual Basic loads the file and displays it in the rightmost pane of the designer window. You can then tailor the page's appearance, if necessary, by changing properties or adding, deleting, or rearranging elements on the page.

When the designer loads the page, it also checks to see what elements exist on the page. It displays all elements in the leftmost pane of the designer window, in the treeview.

Note   You may have difficulty if the page you are trying to use is a frameset document. In addition, any ActiveX controls you have created in Visual Basic must be compiled and set to Public in order to work correctly on your page.

To reference an existing HTML page

  1. If necessary, add a new designer to your project by clicking Add DHTML Page from the Project menu.

    Note   Remember that there is a one-to-one relationship between pages and designers. Each time you want to add a new page to your application, you must first add a designer from the Project menu.

  2. In the DHTMLPage Properties dialog box, click Open, then choose the HTML page you want to import and click OK.

    Visual Basic loads the HTML page when you close the dialog box and displays it in the designer window.

For More Information   See "Understanding the Page Designer Treeview" later in this chapter for more information on the treeview and what it displays in the page designer. See "Using Frames with DHTML Applications" for more information on creating framesets for your DHTML applications.