Microsoft KB Archive/191183

= How To Navigate Between DHTML Designer Pages =

Article ID: 191183

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q191183



SUMMARY
If you have multiple page designers in your application, you can move from one page to another within your application, or you can navigate to a page outside of your DHTML application, including Active Server Pages (ASP) pages.



MORE INFORMATION
The DHTML Designer page is an HTML page with a COM component. Therefore, navigating between multiple page designers is no different than navigating between HTML pages. Following are two examples of navigating between page designer pages.

Using a Hyperlink
If you want to navigate from Page1.htm to Page2.htm when the user clicks on a hyperlink, you need to:


 * 1) Insert a Hyperlink object from the toolbox into Page1.htm.
 * 2) Set the HREF property to "Page2.htm".

NOTE: In step 2 you set the HREF to a relative file name. This is preferred because it works no matter where your files are stored as long as Page1.htm and Page2.htm are in the same location.

You can use an absolute path for HREF as well. For example, you can set this property to http://msdn.microsoft.com/vbasic/Default.asp.

You can change the caption of the hyperlink by simply editing it in the main designer screen.

Additionally, you can convert existing plain text in the designer to a new hyperlink. To convert existing text to a hyperlink, highlight the text and click the "Make Selection into Link" icon from the designer toolbar.

Navigating from Code
You may want to navigate from within your Visual Basic code behind the DHTML page designer, as in the following examples:

  Use the location object available from BaseWindow:

BaseWindow.location.href = "Page2.htm" BaseWindow.location.replace "page2.htm"  'History not maintained. BaseWindow.location.hash = "#bookmark"   'Navigate to bookmark.

  Use the Navigate method from BaseWindow:

BaseWindow.navigate "http://www.microsoft.com/vbasic"



You can use the preceding code within an Onclick event handler of a button element or other elements.

