Sunday, October 19, 2008

Mon Oct 20: help files and the web browser control

Greetings VB coders!

and welcome back from your weekend! Today, before you work on your projects, I want to demonstrate to you how to use a RIDICULOUSLY simple control that has many uses: the web browser control. Here's what you will do:

A) start a new project and name it after yourself plus the letters "WWW"

B) in the form that opens up, drag onto it a button, a textbox and a "webbrowser" control. This last is waaaaaaaayyy down towards the bottom of your list of controls

C) Doubleclick on the button to get into its code

D) Type in the name of your webbrowser control -- most likely it's called "Webbrowser1"

E) type in the period "." This will bring up a list of stuff you can do with this control, including -- oh please, just let it come -- "Navigate"

F) Next, type an opening parenthesis "(", then type in the name of the Textbox, which is probably going to be "TextBox1"

G) Type in the "." again, then choose "Text"

OK, that ought to do it. Run the program, and then type a website address in the textbox, then hit the button; the chosen website should appear in the webbrowser control

SO, what is this control good for? Well for one, it's cool all by itself. More specifically, you can set up some online help, or even offline help in the form of a webpage that goes with your program. It's a lot easier to pack useful information like that in this format, and be able to call it up from your program in this fashion.

OK, enough preaching: be sure to upload this very small and easy to make project to our "Depot" folder. Then, work on your own project some more, and upload that too before the end of the period.

Cheers,

Mr. L

No comments: