home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH14 / 14-2-1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.9 KB  |  93 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.0#0"; "SHDOCVW.DLL"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Simple Web Browser"
  5.    ClientHeight    =   3030
  6.    ClientLeft      =   1530
  7.    ClientTop       =   1530
  8.    ClientWidth     =   6690
  9.    LinkTopic       =   "Form1"
  10.    PaletteMode     =   1  'UseZOrder
  11.    ScaleHeight     =   3030
  12.    ScaleWidth      =   6690
  13.    WindowState     =   2  'Maximized
  14.    Begin SHDocVwCtl.WebBrowser WebBrowser1 
  15.       Height          =   1215
  16.       Left            =   120
  17.       TabIndex        =   4
  18.       Top             =   1200
  19.       Width           =   1815
  20.       Object.Height          =   81
  21.       Object.Width           =   121
  22.       AutoSize        =   0
  23.       ViewMode        =   1
  24.       AutoSizePercentage=   0
  25.       AutoArrange     =   -1  'True
  26.       NoClientEdge    =   -1  'True
  27.       AlignLeft       =   0   'False
  28.    End
  29.    Begin VB.CommandButton cmdQuit 
  30.       Caption         =   "&Quit"
  31.       Height          =   495
  32.       Left            =   1560
  33.       TabIndex        =   3
  34.       Top             =   480
  35.       Width           =   1215
  36.    End
  37.    Begin VB.TextBox txtURL 
  38.       Height          =   375
  39.       Left            =   960
  40.       TabIndex        =   1
  41.       Top             =   0
  42.       Width           =   3135
  43.    End
  44.    Begin VB.CommandButton cmdRetrieve 
  45.       Caption         =   "&Retrieve Document"
  46.       Height          =   495
  47.       Left            =   120
  48.       TabIndex        =   0
  49.       Top             =   480
  50.       Width           =   1215
  51.    End
  52.    Begin VB.Label Label1 
  53.       Alignment       =   2  'Center
  54.       Caption         =   "URL:"
  55.       Height          =   255
  56.       Left            =   240
  57.       TabIndex        =   2
  58.       Top             =   120
  59.       Width           =   615
  60.    End
  61. Attribute VB_Name = "Form1"
  62. Attribute VB_GlobalNameSpace = False
  63. Attribute VB_Creatable = False
  64. Attribute VB_PredeclaredId = True
  65. Attribute VB_Exposed = False
  66. Private Sub cmdQuit_Click()
  67.   End
  68. End Sub
  69. Private Sub cmdRetrieve_Click()
  70.   'Calls up the URL typed in the Text Box
  71.   WebBrowser1.Navigate (txtURL.Text)
  72. End Sub
  73. Private Sub Form_Load()
  74.   WebBrowser1.GoHome  'Calls up Internet Explorer's home page
  75. End Sub
  76. Private Sub Form_Resize()
  77.   'Resizes the Web Browser control with the Form, as long
  78.   'as the form is not minimized.
  79.   'Occurs when an object is first displayed
  80.   If Form1.WindowState <> 1 Then
  81.     WebBrowser1.Width = Form1.ScaleWidth
  82.     WebBrowser1.Height = Form1.ScaleHeight - 740  'Subtract Toolbar height
  83.   End If
  84. End Sub
  85. Private Sub WebBrowser1_NavigateComplete(ByVal URL As String)
  86.   'Is activated when the HTML control finishes
  87.   'retrieving the requested Web page.
  88.   'Updates Text Box
  89. s URL Display to show current URL
  90.   On Error Resume Next    'Eliminates error messages
  91.   txtURL.Text = WebBrowser1.LocationURL
  92. End Sub
  93.