home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch17 / demopage / webform.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1997-02-20  |  1.9 KB  |  52 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.0#0"; "SHDOCVW.DLL"
  3. Begin VB.Form WEBForm 
  4.    BackColor       =   &H0000FFFF&
  5.    Caption         =   "WebForm"
  6.    ClientHeight    =   4440
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   7245
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   4440
  12.    ScaleWidth      =   7245
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin SHDocVwCtl.WebBrowser WebBrowser1 
  15.       Height          =   4125
  16.       Left            =   150
  17.       TabIndex        =   0
  18.       Top             =   120
  19.       Width           =   6930
  20.       Object.Height          =   275
  21.       Object.Width           =   462
  22.       AutoSize        =   0
  23.       ViewMode        =   1
  24.       AutoSizePercentage=   0
  25.       AutoArrange     =   -1  'True
  26.       NoClientEdge    =   -1  'True
  27.       AlignLeft       =   0   'False
  28.    End
  29. Attribute VB_Name = "WEBForm"
  30. Attribute VB_GlobalNameSpace = False
  31. Attribute VB_Creatable = False
  32. Attribute VB_PredeclaredId = True
  33. Attribute VB_Exposed = False
  34. Option Explicit
  35. Private Sub WebBrowser1_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean)
  36. Dim Position, Shape
  37. On Error Resume Next
  38.     If Right$(URL, 8) <> "Demo.htm" Then Cancel = True
  39.     Position = InStr(URL, "#")
  40.     Shape = Mid$(URL, Position + 1)
  41.     If Shape = "circle" Then
  42.         VBForm.Cls
  43.         VBForm.Circle (VBForm.Width / 2, VBForm.Height / 2), VBForm.Height / 3
  44.         VBForm.Label1.Caption = "Circle (Width / 2, Height / 2), Height / 3"
  45.     End If
  46.     If Shape = "box" Then
  47.         VBForm.Cls
  48.         VBForm.Line (VBForm.Width / 4, VBForm.Height / 4)-Step(VBForm.Width / 2, VBForm.Height / 2), , B
  49.         VBForm.Label1.Caption = "Line (Width / 4, Height / 4)-Step(Width / 4, Height / 4), , B"
  50.     End If
  51. End Sub
  52.