Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing Form5.frm (3.83 KB)
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form5
BorderStyle = 3 'Fixed Dialog
Caption = "Text File Tools"
ClientHeight = 1080
ClientLeft = 45
ClientTop = 330
ClientWidth = 4635
ClipControls = 0 'False
Icon = "Form5.frx":0000
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1080
ScaleWidth = 4635
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton Command4
Caption = "&Unprotect"
Height = 375
Left = 3120
TabIndex = 5
ToolTipText = "Unprotect the text file"
Top = 600
Width = 975
End
Begin VB.CommandButton Command3
Caption = "&Protect"
Height = 375
Left = 2040
TabIndex = 4
ToolTipText = "Save protect the text file"
Top = 600
Width = 975
End
Begin VB.CommandButton Command2
Caption = "&Rebuild"
Height = 375
Left = 960
TabIndex = 3
ToolTipText = "Rebuild the text file"
Top = 600
Width = 975
End
Begin VB.CommandButton Command1
Caption = "..."
Height = 315
Left = 4200
TabIndex = 2
ToolTipText = "Browse..."
Top = 120
Width = 315
End
Begin VB.TextBox Text1
Height = 315
Left = 960
MaxLength = 256
TabIndex = 1
Top = 120
Width = 3135
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 0
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DialogTitle = "Open File"
Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
End
Begin VB.Label Label1
Caption = "&Text File: "
Height = 255
Left = 120
TabIndex = 0
Top = 200
Width = 735
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo CancelErr
CommonDialog1.ShowOpen
Text1.Text = CommonDialog1.FileName
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
CancelErr:
End Sub
Private Sub Command2_Click()
RebuildFile Text1.Text, , Chr(10), vbCrLf
'Dim Str As String
'Dim Str2 As String
'Dim i As Integer
' Str = InputBox("Enter the rebuild ascii codes seperated by spaces:", "Rebuild Text File", "10")
' If Str <> "" Then
' i = InStr(Str, " ")
' Do While i > 0
' If InStr(i + 1, Str, " ") Then
' Str2 = Str2 + Chr(Mid(Str, i + 1, InStr(i + 1, Str, " ") - i - 1))
' Else
' Str2 = Str2 + Chr(Mid(Str, i + 1))
' End If
' i = InStr(i + 1, Str, " ")
' Loop
' RebuildFile Str2
' End If
End Sub
Private Sub Command3_Click()
RebuildFile Text1.Text, , vbCrLf, Chr(13) + Chr(13) + Chr(10)
End Sub
Private Sub Command4_Click()
RebuildFile Text1.Text, , Chr(13) + Chr(13) + Chr(10), vbCrLf
End Sub
Private Sub Form_Load()
CommonDialog1.Flags = cdlOFNOverwritePrompt + cdlOFNLongNames + cdlOFNHideReadOnly
End Sub