March 16th, 2003, 06:04 PM
Create a web page with VB
I am not going to cover all the basic of visual basic, since there is a lot of tutorials you can find here on Antionline. To complete creating the web page with visual basic you are going to need Internet Explorer4.0 or later a vb compiler and since you are reading it , I assume you have access to computer. So lets cut the crap and go for the meat.
You can create two type of Internet apps with vb
1) IIS apps
2)DHTML apps(Dynamic Hypertext Markup Lang.)
All the processing for an IIS apps happens on the web server and DHTML applications processing happens on the browser computer. In this tut I am going to use DHTML to create a web page.
1) Start VB. When New Project dialog box appears, scroll the New tab's list box, then click DHTML. Cllick open button. Now visual basic will open a new DHTML project. If it doesn't work go to File then click New Project to open the New Project dialog box and then click DHTML.
2) Right click modDHTML in the Project window, then click Remove modDHTML.
Now you can give the DHTML project what ever name you want to give.
3) Change th project's Name property to any name youu can remember like web page or web project anything it is up to you.
4) Click DHTML Page1 in the Project window, and then click the Project window's View Object button. Visual Basic displays the DHTML page designer window for page 1 of the DHTML project. If you want to include more than one web page , you can use the add DHTML page option on the project menu to add another page to the project. Visual Basic will provide a separate page designer window for each page included in the project. The page designer window contains a title bar, toolbars, and two panes: the treeview pane and the detail pane.
Treeview Pane: It displays the list of all of the elements included in the detail pane. You will learn more about Treeview Pane later in this tut.
Detail Pane: It presents a drawing surface on which you can create a new page or edit an existing page.
So now go ahead and make detail pane larger so that you can use more drawing surface. Then we will add some text to the detail pane.
5) Maximize the page designer window, then drag the bar that separates the designer window's panes until you think you get enough space for work and then release the mouse button. Now click on detail pane and type anything you want lets say you want to type[ This is a web site to discuss how to secure your computer and for more information click here and so on]. Don't worry if you see information in the treeview pane changes. So that is it you can add what ever you want to show on your web page just simply by typing the text in the page disinger window's detail pane.
Now I am going to discuss how to add an image to your web site.
6) Restore the page designer window then double click the Image tool in the toolbox to place in image control in the detail pane. Maximize the page designer window, then drag and size the image control untill you think it is enough space for your image.
7) Press the Alt to display Visual Basic's main window, then click View, and then click Properties Window, Click Custom in the properties window, then click the ... button in the Settings box to open the image control's Property Pages dialog box. Click the ... button that appears to the right of the Image source text box. The open dialog box appears. Use the Open dialog box to locate the computer.wmf file, which is typically located in the Program Files\Microsoft Visual Studio\Common\Graphichs\Metafile\Business folder on either the local hard drive or the network drive. Click the Computer.wmf, then click the Open button, and then click the OK button. A picture of a omputer appears in the image control.
Next you can make a phrase Microsoft Web site, into a hyperlink that iwll connect the web page to MIcrosoft's home page. I am using it just as an example you can type anyone web site to connect your page.
8) Select the phrase Microsoft web site, then click the Make Selection into link button on the page designer window's tolbar. The phrase appears as yellow lettering on a black background. You will notice that the phrase is underlined, which indicates that it is a hyperlink.
Now you need to provide the hyperlink with the address of Microsoft's home page.
9) Press Alt to display vb's main window, then click View, and then click Properties Window. Use the Object box in the properties window to select the Hyperlink1 (Disp1HTMLAnchorElement) element. Click (custom), and then click the ... button in te settings box. The hyperlink's Property Pages dialog box appears. Click the Link type list arrow on the General tab. Scroll the list, then click http: . You will notice that this places http:// in the Link text box. Click after the second slash in the Link text box, then type www.microsoft or anyother which you decide to connect with your web page.
10) Click OK to close the Property Pages dialog box. Click after the period in the second sentence to cancel the selection of the hyperlink phrase. Now save the web page and project.
11) Press Alt to display vb's main window, then click File, and then click Save DHTMLPage1 As. When the save file a dialog box appears, type ApCPage in the Filename textg box. This file will be saved as a Designer File with a .Dsr extension. Click the save button.
Now lets go to treeview pane, which shows a hierarchicla listing of the elements included in the detail pane.
1) Drag the bar that separates both designer window pane to the right then click Document in the treeview pane.
2) Click Body
3) Click P
4) Click Hyperlink1 A
5) Click P(<iMG alt='"' border=0 height=238 hspace=0 id). Visual Basic selects the second paragraph, which contains only the image control.
6Click Image1 IMG(). Visual Basic selects only the image control included int eh second paragraph.
After creating the web page, you then instruct vb to create the appropriate html code for you.
To tell vb to create the HTmL code for your web page, then view the HTML code
1) Click the DHTML Page Designer Properties button on the page designer's toolbar. The DHTMLPage1 Properties dialog box appears. Click the Save HTML in an externeal file option buton, then click the Nesw button. The Create HTML file dialog box appears. Notice that the file will be saved as an HTML file.
2) When the save internel HTML dialog box appears, click the Yes button.
3) Click the Launch Editor button on the page designer's toolbalr. Mazimize the editor window.You are going to see HTML code generated by vb in the window.
4) Close the editor window.
All that remains is to view your web page using a browser. You can either run the project while you are in vb, or youcan start IE and use the open option on its file menu to open the .htm file.
To view you web page
1 Save it andExit visual basic.
2 start IE click file then click open. open the file you just save.
3 Click Microsoft web site. now you are going to be on Microsft's home page. Close internet explorer.
You can play around with it and can create any kind of web page or even the whole web site.