home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch21 / demopage / webform.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1998-05-19  |  2.1 KB  |  56 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
  3. Begin VB.Form WEBForm 
  4.    BackColor       =   &H0000FFFF&
  5.    Caption         =   "WebForm"
  6.    ClientHeight    =   5010
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   7950
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   5010
  12.    ScaleWidth      =   7950
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin SHDocVwCtl.WebBrowser WebBrowser1 
  15.       Height          =   4860
  16.       Left            =   75
  17.       TabIndex        =   0
  18.       Top             =   90
  19.       Width           =   7785
  20.       ExtentX         =   13732
  21.       ExtentY         =   8572
  22.       ViewMode        =   1
  23.       Offline         =   0
  24.       Silent          =   0
  25.       RegisterAsBrowser=   0
  26.       RegisterAsDropTarget=   0
  27.       AutoArrange     =   -1  'True
  28.       NoClientEdge    =   -1  'True
  29.       AlignLeft       =   0   'False
  30.       ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  31.       Location        =   ""
  32.    End
  33. Attribute VB_Name = "WEBForm"
  34. Attribute VB_GlobalNameSpace = False
  35. Attribute VB_Creatable = False
  36. Attribute VB_PredeclaredId = True
  37. Attribute VB_Exposed = False
  38. Option Explicit
  39. Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
  40. Dim Position As Integer, Shape As String
  41. On Error Resume Next
  42.     If UCase(Right$(URL, 8)) <> "DEMO.HTM" Then Cancel = True
  43.     Position = InStr(URL, "#")
  44.     Shape = Mid$(URL, Position + 1)
  45.     If Shape = "circle" Then
  46.         VBForm.Cls
  47.         VBForm.Circle (VBForm.Width / 2, VBForm.Height / 2), VBForm.Height / 3
  48.         VBForm.Label1.Caption = "Circle (Width / 2, Height / 2), Height / 3"
  49.     End If
  50.     If Shape = "box" Then
  51.         VBForm.Cls
  52.         VBForm.Line (VBForm.Width / 4, VBForm.Height / 4)-Step(VBForm.Width / 2, VBForm.Height / 2), , B
  53.         VBForm.Label1.Caption = "Line (Width / 4, Height / 4)-Step(Width / 4, Height / 4), , B"
  54.     End If
  55. End Sub
  56.