|
Displaying HTML Documents Using Internet Explorer |
|
| Adding IE to the Toolbox | |
|
One thing you DO have to worry about is that most browser based applications use a web server. And if you do anything more than just display the information, the server is required. Again, we look at a whirlwind view of server based applications in the next chapter, but keep in mind that if your application can't access a web server, there might not be too much that it can do. But there is more to the Internet Explorer object than the book presents. For example, there is a way to implement this object in your program other than the one presented in the book. The book describes how to add the SHDocVw.dll to the References section of Solution Explorer. You can also add the IE browser to the VB.NET Toolbox. Here's how that is done ... Right-click on the Toolbox to display the context menu, then select Add/Remove Items ... and click the COM Components tab in the next window. Browse down to Microsoft Web Browser and click the check box. You'll see a new component added to the section of the Toolbox that was expanded as you did this. Doing it this way (instead of the way the book describes) gives you a slightly different result. You will discover that another DLL has been automatically added to the References in your program called AxSHDocVw.dll. This is the ActiveX Wrapper (that's what the "Ax" means) for the DLL and it allows the Internet Explorer COM object to be hosted in a VB.NET form. (The method described in the book gives you a new instance of the entire IE object which stays open even after you exit from your application.) Here's how Microsoft explains it: To host the ActiveX control, you must generate a wrapper control (which) contains an instance of the underlying ActiveX control. It knows how to communicate with the ActiveX control, but it appears as a Windows Forms control. This generated control hosts the ActiveX control and exposes its properties, methods, and events as those of the generated control. Note that the properties are available to your program now just like any other Windows Forms control! |
|

