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-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  3.8 KB  |  125 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    =   2550
  6.    ClientLeft      =   1530
  7.    ClientTop       =   1530
  8.    ClientWidth     =   6000
  9.    LinkTopic       =   "Form1"
  10.    PaletteMode     =   1  'UseZOrder
  11.    ScaleHeight     =   2550
  12.    ScaleWidth      =   6000
  13.    WindowState     =   2  'Maximized
  14.    Begin SHDocVwCtl.WebBrowser WebBrowser1 
  15.       Height          =   735
  16.       Left            =   120
  17.       TabIndex        =   7
  18.       Top             =   1560
  19.       Width           =   1215
  20.       Object.Height          =   49
  21.       Object.Width           =   81
  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 cmdPH 
  30.       Height          =   735
  31.       Left            =   3120
  32.       Picture         =   "14-2-2.frx":0000
  33.       Style           =   1  'Graphical
  34.       TabIndex        =   6
  35.       Top             =   600
  36.       Width           =   1335
  37.    End
  38.    Begin VB.CommandButton cmdBack 
  39.       Caption         =   "&Back"
  40.       Height          =   735
  41.       Left            =   1560
  42.       TabIndex        =   4
  43.       Top             =   600
  44.       Width           =   1335
  45.    End
  46.    Begin VB.CommandButton cmdQuit 
  47.       Caption         =   "&Quit"
  48.       Height          =   735
  49.       Left            =   4680
  50.       TabIndex        =   3
  51.       Top             =   600
  52.       Width           =   1215
  53.    End
  54.    Begin VB.TextBox txtURL 
  55.       Height          =   375
  56.       Left            =   960
  57.       TabIndex        =   1
  58.       Top             =   0
  59.       Width           =   3135
  60.    End
  61.    Begin VB.CommandButton cmdRetrieve 
  62.       Caption         =   "&Retrieve Document"
  63.       Default         =   -1  'True
  64.       Height          =   735
  65.       Left            =   120
  66.       TabIndex        =   0
  67.       Top             =   600
  68.       Width           =   1215
  69.    End
  70.    Begin VB.Label lblStatus 
  71.       Height          =   375
  72.       Left            =   4560
  73.       TabIndex        =   5
  74.       Top             =   120
  75.       Width           =   2655
  76.    End
  77.    Begin VB.Label Label1 
  78.       Alignment       =   2  'Center
  79.       Caption         =   "URL:"
  80.       Height          =   255
  81.       Left            =   240
  82.       TabIndex        =   2
  83.       Top             =   120
  84.       Width           =   615
  85.    End
  86. Attribute VB_Name = "Form1"
  87. Attribute VB_GlobalNameSpace = False
  88. Attribute VB_Creatable = False
  89. Attribute VB_PredeclaredId = True
  90. Attribute VB_Exposed = False
  91. Private Sub Form_Load()
  92.   WebBrowser1.GoHome  'Calls up Internet Explorer's home page
  93. End Sub
  94. Private Sub Form_Resize()
  95.   'Resizes the Web Browser control with the Form, as long
  96.   'as the form is not minimized.
  97.   'Occurs when the Form is first displayed.
  98.   If Form1.WindowState <> 1 Then
  99.       WebBrowser1.Width = Form1.ScaleWidth
  100.       WebBrowser1.Height = Form1.ScaleHeight - 740  'Subtract Toolbar height
  101.   End If
  102. End Sub
  103. Private Sub cmdRetrieve_Click()
  104.   'Calls up the URL typed in the Text Box
  105.   WebBrowser1.Navigate (txtURL.Text)
  106. End Sub
  107. Private Sub cmdBack_Click()
  108.   WebBrowser1.GoBack
  109. End Sub
  110. Private Sub cmdPH_Click()
  111.   WebBrowser1.Navigate ("http://www.prenhall.com")
  112. End Sub
  113. Private Sub cmdQuit_Click()
  114.   End
  115. End Sub
  116. Private Sub WebBrowser1_NavigateComplete(ByVal URL As String)
  117.   'Updates Text Box
  118. s URL Display to show current URL
  119.   On Error Resume Next  'Eliminates error messages
  120.   txtURL.Text = WebBrowser1.LocationURL
  121. End Sub
  122. Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
  123.   lblStatus.Caption = Text
  124. End Sub
  125.