Final project for 810:151 section 01 Visual Basic - due February 14th... Your web browser assignment will have the following features: 1. Your WebBrowser control will automatically resize when the user resizes the application (Form_Resize() event) window. Your application should allow the user to minimize the browser window too, so be careful to handle that situation smoothly. 2. Your application will have a ComboBox or a ListBox control that displays a list of the user's favorite links or bookmarks. This bookmarks list will Navigate to the corresponding URL when the user clicks on the bookmark. This bookmark list will be read in from a file. Your file might be called favoriteURLs.txt, for example. The format of this file should be that it contains two fields: The field for the actual URL. The field for the bookmark description, which will usually be the title from the page, but can be whatever the user chooses when they set the bookmark. What property tells the Title of the current web page? What is this property set to if the web page is a .txt URL or if the web page is one where the HEAD of the HTML document has no TITLE? The file will be updated when the user closes the application. Any new bookmarks that the user has created during the session will be saved, so that next time they restart the application, those additional bookmarks will be saved. 3. Here is an example created during class during the first week of 810:151 class. ' Here is an example from the first week of 810:151 class in 2003 ' Just a code snippet. Type it in and try it out. Private Sub Form_Click() Print WebBrowser1.LocationName Print WebBrowser1.LocationURL WebBrowser1.Navigate "http://www.ucsd.edu" End Sub Private Sub Form_Load() WebBrowser1.Navigate "http://www.uni.edu" End Sub 4. Your application should display a splash screen for about 5 seconds when it starts up. Only after the splash screen is done displaying info about your panther browser software should the user see the main browser application window start up. 5. Respond to the txtURL TextBox for entering the URL when the user presses the Enter key (vbKeyReturn) by invoking the .Navigate method to go to the URL they typed in..... 6. To be continued..... ------------------------------------------------------------------------- ' Written and handed out on June 25th, 2000 *** and February of 2003 *** ------------------------------------------------------------------------- Private Sub cmdGoToURL_Click() WebBrowser1.Navigate txtURL End Sub Private Sub cmdUNI_Click() WebBrowser1.Navigate "http://www.uni.edu" End Sub Private Sub Form_Load() Form_Resize End Sub ' What is the ScaleMode of the FORM? ' Twips (1440 per inch) or is it Pixels??? ' 25 Twips is very small, ' 25 Pixels is much larger... Private Sub Form_Resize() WebBrowser1.Height = Form1.ScaleHeight - WebBrowser1.Top - 25 WebBrowser1.Width = Form1.ScaleWidth - 25 End Sub Private Sub lstURLs_Click() WebBrowser1.Navigate lstURLs.Text End Sub Private Sub txtURL_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then WebBrowser1.Navigate txtURL End If End Sub Private Sub WebBrowser1_NavigateComplete2( ByVal pDisp As Object, _ URL As Variant ) Form1.Caption = WebBrowser1.LocationName End Sub Private Sub WebBrowser1_TitleChange(ByVal Text As String) Form1.Caption = WebBrowser1.LocationName End Sub ****************** Handed out on February 3rd, 2003 ******************* ****************** Including screen snapshot of app ******************* **************Illustrates ListBox of URLs, very simply******* Private Sub Form_Load() WebBrowser1.Navigate "www.usd.edu" End Sub Private Sub lstTitles_Click() WebBrowser1.Navigate lstURLs.List(lstTitles.ListIndex) End Sub *************** lstTitles is a ListBox control *******************