|
-
Nov 7th, 2000, 11:56 AM
#1
Thread Starter
Hyperactive Member
Hi All!
I have a FileListBox named fleNotes, a RichTextBox called rtbNote.
I have this code:
Code:
Private Sub fleNotes_Click()
If fleNotes.filename = "" Then
MsgBox "No note selected!"
Else
rtbNote.LoadFile fleNotes.Path & "\" & fleNotes.filename
End If
End Sub
I want this code to open the file in rtbNote but it doesn't...
It was supposed to load a file made with this code that has txtNewNote which when saved, it is the filename.txt, a RichTextBox named rtbNewNote which is the content of the file, and a commandbutton named cmdCreate.
This is the code:
Code:
Private Sub cmdCreate_Click()
rtbNewNote.SaveFile App.Path & "\Notes\" & txtNewNote.Text & ".txt"
End Sub
This workd but it makes the content something close to gibberish.
Can anybdy help me???
-
Nov 7th, 2000, 12:25 PM
#2
Fanatic Member
When you use the SaveFile and LoadFile methods of a RichTextBox, you should specify the right format, especially for saving.
Code:
'to save in normal text
RichTextBox1.SaveFile "filename.txt", rtfText
'to save in richtext
RichTextBox1.SaveFile "filename.rtf", rtfRTF
You should specify the correct format when loading as well. I think RTF format is the default, so if you're using a normal text file this could be why you see gibberish (just my educated guess... may or may not be the case.) Hope this helps.
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Nov 7th, 2000, 04:29 PM
#3
Thread Starter
Hyperactive Member
Ok, it doens't show gibberish, now that's a step forward.
Buuuuut... The text is transperent and I have to select the text and paste it to another place in order to see it.
I solved it by doing an invisible RichTextBox and when I load the file into the invisible RTB then it will do this:
Code:
rtbVisible.Text = rtbInvisible.Text
This works perfectly fine but does anybody know how to bypass this? There's gotta be a way.
-
Nov 7th, 2000, 04:31 PM
#4
Thread Starter
Hyperactive Member
Hmmmm...
Never mind!
My computer has decided to make it work!
Thanks for your help, man!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|