help文件制作者,vb源码

源代码在线查看: frmhelp.frm

软件大小: 33 K
上传用户: multicolor
关键词: help vb 源码
下载地址: 免注册下载 普通下载 VIP

相关代码

				VERSION 5.00
				Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
				Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
				Begin VB.Form frmHelp 
				   BackColor       =   &H00000000&
				   Caption         =   "HELP VIEWER"
				   ClientHeight    =   4935
				   ClientLeft      =   60
				   ClientTop       =   345
				   ClientWidth     =   7665
				   Icon            =   "frmHelp.frx":0000
				   LinkTopic       =   "Form1"
				   ScaleHeight     =   329
				   ScaleMode       =   3  'Pixel
				   ScaleWidth      =   511
				   StartUpPosition =   2  'CenterScreen
				   Begin VB.CommandButton cmdMenu 
				      Cancel          =   -1  'True
				      Caption         =   "&MENU"
				      Height          =   255
				      Left            =   0
				      Style           =   1  'Graphical
				      TabIndex        =   2
				      Top             =   0
				      Width           =   2175
				   End
				   Begin ComctlLib.TreeView TreeView1 
				      Height          =   3615
				      Left            =   0
				      TabIndex        =   1
				      Top             =   600
				      Width           =   2175
				      _ExtentX        =   3836
				      _ExtentY        =   6376
				      _Version        =   327682
				      Indentation     =   397
				      LabelEdit       =   1
				      Style           =   7
				      ImageList       =   "ImageList1"
				      BorderStyle     =   1
				      Appearance      =   1
				   End
				   Begin RichTextLib.RichTextBox WB1 
				      Height          =   2775
				      Left            =   3480
				      TabIndex        =   0
				      Top             =   720
				      Width           =   4095
				      _ExtentX        =   7223
				      _ExtentY        =   4895
				      _Version        =   327681
				      Enabled         =   -1  'True
				      ReadOnly        =   -1  'True
				      ScrollBars      =   2
				      TextRTF         =   $"frmHelp.frx":0442
				   End
				   Begin ComctlLib.ImageList ImageList1 
				      Left            =   4560
				      Top             =   3840
				      _ExtentX        =   1005
				      _ExtentY        =   1005
				      BackColor       =   -2147483643
				      ImageWidth      =   16
				      ImageHeight     =   16
				      MaskColor       =   12632256
				      _Version        =   327682
				      BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
				         NumListImages   =   3
				         BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
				            Picture         =   "frmHelp.frx":050B
				            Key             =   "Closed"
				         EndProperty
				         BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
				            Picture         =   "frmHelp.frx":085D
				            Key             =   "Document"
				         EndProperty
				         BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
				            Picture         =   "frmHelp.frx":0BAF
				            Key             =   "Open"
				         EndProperty
				      EndProperty
				   End
				   Begin VB.Menu mnuMnu 
				      Caption         =   "&Menu"
				      Visible         =   0   'False
				      Begin VB.Menu mnuMnuQuit 
				         Caption         =   "&Quit"
				      End
				   End
				End
				Attribute VB_Name = "frmHelp"
				Attribute VB_GlobalNameSpace = False
				Attribute VB_Creatable = False
				Attribute VB_PredeclaredId = True
				Attribute VB_Exposed = False
				Dim INI As New clsIniFile
				Dim NumEntries As Integer
				Private Type Entry
				    ListItem As String
				    ListTarget As String
				    Relative As String
				    Node As Boolean
				    Key As String
				End Type
				Dim Help(32767) As Entry    'Maximum of 32768 entries
				Dim ListWidth As Integer
				Dim FormTitle As String
				Sub GetData()
				Dim Keyx As String
				TreeView1.ImageList = ImageList1
				Dim nodX As Node
				    Set nodX = TreeView1.Nodes.Add(, , "Root", "Help Topics", "Closed")
				INI.FullPath = App.Path & "\Help.INI"
				INI.SectionName = "General"
				NumEntries = INI.GetString("Entries", "1")
				ListWidth = INI.GetString("ListWidth", "225")
				FormTitle = INI.GetString("Form Title", "Clone Help")
				frmHelp.Caption = FormTitle
				For i = 1 To NumEntries
				    INI.SectionName = i
				    Keyx = i
				    Help(i).ListItem = INI.GetString("ListItem", "")
				    Help(i).ListTarget = App.Path & "\" & INI.GetString("ListTarget", "")
				    Help(i).Relative = INI.GetString("Relative", "Root")
				    Help(i).Node = INI.GetString("Node", "False")
				    Help(i).Key = INI.GetString("Key", Help(i).ListItem)
				    If Help(i).Node = False Then
				        Set nodX = TreeView1.Nodes.Add(Help(i).Relative, tvwChild, Help(i).Key, Help(i).ListItem, "Document")
				    Else
				        Set nodX = TreeView1.Nodes.Add(Help(i).Relative, tvwChild, Help(i).Key, Help(i).ListItem, "Closed")
				    End If
				Next i
				End Sub
				
				
				
				
				Sub LoadHTML(Number As Integer)
				Select Case Right(Help(Number).ListTarget, 3)
				    Case "rtf"
				        WB1.LoadFile Help(Number).ListTarget, rtfRTF
				    Case "txt"
				        WB1.SelColor = RGB(0, 0, 0)
				        WB1.SelBold = False
				        WB1.SelFontSize = 10
				        WB1.LoadFile Help(Number).ListTarget, rtfText
				    Case ""
				End Select
				End Sub
				
				Private Sub cmdMenu_Click()
				PopupMenu mnuMnu, , 0, 0, mnuMnuQuit
				End Sub
				
				Private Sub Form_Load()
				GetData
				End Sub
				
				
				Private Sub Form_Resize()
				cmdMenu.Width = ListWidth
				cmdMenu.Top = 0
				cmdMenu.Left = 0
				TreeView1.Top = cmdMenu.Height
				TreeView1.Left = 0
				TreeView1.Width = ListWidth
				TreeView1.Height = frmHelp.ScaleHeight - cmdMenu.Height
				WB1.Top = 0
				WB1.Left = ListWidth + 1
				WB1.Width = frmHelp.ScaleWidth - TreeView1.Width
				WB1.Height = frmHelp.ScaleHeight
				End Sub
				
				
				
				
				
				
				
				
				
				
				
				Private Sub mnuMnuQuit_Click()
				X = MsgBox("Are You Sure that you want to quit?", vbYesNo, "Quit?")
				If X = 6 Then
				    End
				End If
				End Sub
				
				Private Sub TreeView1_Collapse(ByVal Node As ComctlLib.Node)
				Node.Image = "Closed"
				End Sub
				
				Private Sub TreeView1_Expand(ByVal Node As ComctlLib.Node)
				Node.Image = "Open"
				End Sub
				
				Private Sub TreeView1_NodeClick(ByVal Node As ComctlLib.Node)
				LoadHTML (Node.Index - 1)
				End Sub
				
				
							

相关资源