home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / COMPTOOL / ACTVCOMP / ACTXDOC / FIRSTDOC.DOB (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-10-15  |  4.6 KB  |  143 lines

  1. VERSION 5.00
  2. Begin VB.UserDocument FirstDoc 
  3.    ClientHeight    =   2130
  4.    ClientLeft      =   0
  5.    ClientTop       =   900
  6.    ClientWidth     =   4770
  7.    HScrollSmallChange=   225
  8.    ScaleHeight     =   2130
  9.    ScaleWidth      =   4770
  10.    VScrollSmallChange=   225
  11.    Begin VB.TextBox txtFirstDoc 
  12.       Height          =   285
  13.       Left            =   1800
  14.       TabIndex        =   4
  15.       Top             =   1080
  16.       Width           =   2655
  17.    End
  18.    Begin VB.TextBox txtURL 
  19.       Height          =   285
  20.       Left            =   1800
  21.       TabIndex        =   3
  22.       Text            =   "http://www.microsoft.com"
  23.       Top             =   465
  24.       Width           =   2775
  25.    End
  26.    Begin VB.CommandButton cmdNavigateTo 
  27.       Caption         =   "NavigateTo"
  28.       Height          =   255
  29.       Left            =   240
  30.       TabIndex        =   2
  31.       Top             =   480
  32.       Width           =   1455
  33.    End
  34.    Begin VB.CommandButton cmdShowForm 
  35.       Caption         =   "Show Form"
  36.       Height          =   255
  37.       Left            =   240
  38.       TabIndex        =   1
  39.       Top             =   1680
  40.       Width           =   1455
  41.    End
  42.    Begin VB.CommandButton cmdGoNext 
  43.       Caption         =   "Go Next"
  44.       Height          =   255
  45.       Left            =   240
  46.       TabIndex        =   0
  47.       Top             =   1095
  48.       Width           =   1455
  49.    End
  50.    Begin VB.Menu mnuHelp 
  51.       Caption         =   "&Help"
  52.       NegotiatePosition=   3  'Right
  53.       Begin VB.Menu mnuAbout 
  54.          Caption         =   "About FirstDoc"
  55.       End
  56.    End
  57. Attribute VB_Name = "FirstDoc"
  58. Attribute VB_GlobalNameSpace = False
  59. Attribute VB_Creatable = True
  60. Attribute VB_PredeclaredId = False
  61. Attribute VB_Exposed = True
  62. Option Explicit
  63. Private Sub cmdGoNext_Click()
  64.     Dim strPath As String    ' String to be parsed
  65.     Dim strAbsPath As String ' Result of parsing
  66.     Dim intI As Integer      ' Character position counter
  67.     ' Return the path of the current ActiveX document.
  68.     strPath = Trim$(UserDocument.Parent.LocationName)
  69.     ' Find the position of the last separator character.
  70.     For intI = Len(strPath) To 1 Step -1
  71.         If Mid$(strPath, intI, 1) = "/" Or _
  72.             Mid$(strPath, intI, 1) = "\" Then Exit For
  73.     Next intI
  74.     ' Strip the name of the current .vbd file.
  75.     strAbsPath = Left$(strPath, intI)
  76.     ' Set the global variable to Me, allowing
  77.     ' the SecndDoc document to get any public
  78.     ' properties, or call any public functions.
  79.     Set gFirstDoc = Me '
  80.     ' Navigate to the second ActiveX document.
  81.     UserDocument.Hyperlink.NavigateTo _
  82.         strAbsPath & "SecndDoc.vbd"
  83. End Sub
  84.  Private Sub cmdNavigateTo_Click()
  85.    ' Use the Hyperlink object method NavigateTo
  86.    ' to go to the URL in txtURL.
  87.    Hyperlink.NavigateTo txtURL.Text
  88.  End Sub
  89. Private Sub cmdShowForm_Click()
  90.    ' Show the auxiliary form, and set the Text
  91.    ' property of txtAux to the URL of FirstDoc.
  92.    frmAux.txtAux.Text = txtURL.Text
  93.    frmAux.Show vbModal
  94. End Sub
  95. Private Sub mnuAbout_Click()
  96.    frmAbout.Show vbModal
  97. End Sub
  98. Private Sub txtFirstDoc_Change()
  99.    PropertyChanged
  100. End Sub
  101.  Private Sub UserDocument_Hide()
  102.     ' Count the number of times this instance of the
  103.     ' document is hidden. Declare a static variable,
  104.     ' and increment it by one every time the event occurs.
  105.     Static i As Integer
  106.     i = i + 1
  107.    Debug.Print "FirstDoc Hide " & i
  108.  End Sub
  109. Public Property Get strDocProp() As String
  110.    strDocProp = txtFirstDoc.Text
  111. End Property
  112. Public Property Let strDocProp(ByVal NewStrDocProp As String)
  113.    txtFirstDoc.Text = NewStrDocProp
  114. End Property
  115. Private Sub UserDocument_Initialize()
  116.    Debug.Print "FirstDoc Initialize"
  117. End Sub
  118. Private Sub UserDocument_InitProperties()
  119.    Debug.Print "FirstDoc Init Properties"
  120. End Sub
  121. Private Sub UserDocument_ReadProperties(PropBag As PropertyBag)
  122.    txtFirstDoc.Text = _
  123.    PropBag.ReadProperty("StrDocProp", _
  124.    "Hello")
  125.    Debug.Print "ReadProperties"
  126. End Sub
  127. Private Sub UserDocument_Show()
  128.     ' Count the number of times this instance of the
  129.     ' document is shown. Declare a static variable,
  130.     ' and increment it by one every time the event occurs.
  131.     Static i As Integer
  132.     i = i + 1
  133.    Debug.Print "FirstDoc Show " & i
  134. End Sub
  135. Private Sub UserDocument_Terminate()
  136.    Debug.Print "FirstDoc Terminate"
  137. End Sub
  138. Private Sub UserDocument_WriteProperties(PropBag As PropertyBag)
  139.    PropBag.WriteProperty "StrDocProp", _
  140.    txtFirstDoc.Text, "Hello"
  141.    Debug.Print "WriteProperties"
  142. End Sub
  143.