i have built a text editor, and it works good, and i have set it to be the default program for opening text files. but when i click on a text file, it opens my text editor, but with no text. i have to open the text file after my text editor is already open? here is my code so far;
************************************************** ********
Private Sub Command1_Click()
CommonDialog1.Filter = "Text Files (*.txt)|*.txt|HTML|*.HTML|All Files|*.*"
CommonDialog1.InitDir = "X:\"
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Output As 1
Print #1, Text1.Text
Close 1
End If
End Sub
Private Sub Command2_Click()
CommonDialog1.Filter = "Text Files (*.txt)|*.txt|HTML|*.HTML|All Files|*.*"
CommonDialog1.InitDir = "X:\"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
Text1.Text = ""
Dim strPath As String
Dim strText As String
strPath = CommonDialog1.FileName
n = Chr(13) + Chr(10) ' this is a charater return
Open strPath For Input As 1
Do Until EOF(1)
Line Input #1, strText
Text1.Text = Text1.Text & strText & n
Loop
Close #1
End If
End Sub
Private Sub Command3_Click()
If Text1.Text <> "" Then
REPLY = MsgBox("ERASE ALL TEXT AND START NEW?", vbYesNo)
If REPLY = vbYes Then Text1.Text = ""
End If
End Sub
Private Sub Command4_Click()
Clipboard.SetText (Text1.Text)
End Sub
Private Sub Command5_Click()
Text1.Text = Clipboard.GetText
End Sub
Private Sub Command6_Click()
If Text1.Text <> "" Then
Printer.Print Text1.Text
Printer.EndDoc
End If
End Sub
Private Sub Command7_Click()
If Text1.Text <> "" Then
REPLY = MsgBox("QUIT WITHOUT SAVING?", vbYesNo)
If REPLY = vbYes Then End
End If
End Sub
Private Sub Command8_Click()
Form2.Show
End Sub
************************************************** ********
also, is there a way to get the scrollbar to stay invisable until the page is filled in a regular textbox, like it does in a rich text box?
[email protected]
WWW.GRIMMUSIC.COM