home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.MDIForm mdiWbrDOM
- BackColor = &H8000000C&
- ClientHeight = 3510
- ClientLeft = 1260
- ClientTop = 630
- ClientWidth = 5280
- NegotiateToolbars= 0 'False
- ScrollBars = 0 'False
- Begin MSComctlLib.StatusBar sta
- Align = 2 'Align Bottom
- Height = 315
- Left = 0
- TabIndex = 0
- Top = 3195
- Width = 5280
- _ExtentX = 9313
- _ExtentY = 556
- Style = 1
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 1
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- EndProperty
- EndProperty
- End
- Begin VB.Menu mnuFileMenu
- Caption = "&File"
- Begin VB.Menu mnuFileOpen
- Caption = "&Open..."
- Shortcut = ^O
- End
- Begin VB.Menu mnuFileBar1
- Caption = "-"
- End
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Attribute VB_Name = "mdiWbrDOM"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Questions contact markb@orionstudios.com
- ' Demonstrates DOM programming from Vb6 including
- ' build document in empty WebBrowser Control
- ' build DIV element as progress display
- ' build Stylesheet with code
- ' convert tab-deliited text to HTML Table with
- ' Header, Footer, Caption, Column definitions
- ' enable/disable formatting
- ' replace standard context (right-click) popup menu
- ' set document title, table caption
- ' save constructed document as HTML
- ' generalised class to recurse document structure
- ' extract stylesheet information
- ' build UL object with expand/collapse
- ' cloning
- ' intercept events from WebBrowser document
- ' using a behavior
- ' Requires Project/References entry for
- ' Microsoft HTML Object Library (MSHTML.tlb)
- '=================================================================================
- Private mDefaultPath As String
- Public Property Let StatusText(ByVal vData As String) ' Messages from child forms
- sta.SimpleText = vData ' with no status bar.
- sta.Refresh
- End Property
- Private Sub MDIForm_Load()
- Me.Move 1200, 0, 9000, 8400
- Me.Caption = App.FileDescription
- mDefaultPath = App.Path & "\"
- End Sub
- Private Sub mnuFileOpen_Click()
- Dim strFileName As String
- strFileName = GetFileName
- If Len(strFileName) Then
- With New frmDOMTable
- Set .MDIParent = Me
- .DataFileSpec = strFileName
- .Show
- End With
- End If
- End Sub
- Private Sub mnuFileExit_Click()
- Unload Me
- End Sub
- Private Function GetFileName() As String
- ' Returns full path of selected existing file. Uses FileDlg.cls.
- On Error GoTo GetFileName_Error
- Dim Result As String ' default function result = ""
- Dim strFileName As String
- With New FileDlg
- .Title = "Select tab-delimited text file"
- .DefaultDir = mDefaultPath & "Work"
- .Owner = Me.hWnd
- .AddFilter "Tab-delimited Text Files (*.txt,*tab):*.txt;*tab"
- If .Show(DlgType:=OpenDialog) Then
- strFileName = .PathFile
- End If
- End With
- DoEvents
- Result = strFileName
- GetFileName_Exit:
- GetFileName = Result
- Exit Function
- GetFileName_Error:
- MsgBox Err.Number & " - " & Err.Description, vbExclamation, "GetFileName"
- Resume GetFileName_Exit
- End Function
-