|
-
Dec 31st, 2002, 11:21 AM
#1
Thread Starter
Hyperactive Member
Read file into richtextbox *[resolved]*
How? I've searched the forum and came across this:
VB Code:
Dim fs As FileStream = New FileStream(Application.StartupPath & "\snippets.txt", IO.FileMode.Open)
Dim sw As New StreamWriter(fs)
sw.Write(rtbcodewindow.Text)
sw.Close()
fs.Close()
but nothing seems to happen!
I have a toolbar and pressing various buttons will load an associated rtf file, plain and simple, but how? I need the exact code as I can get bugger all to work!
Last edited by RealNickyDude; Dec 31st, 2002 at 12:01 PM.
-
Dec 31st, 2002, 11:34 AM
#2
Sleep mode
I'm sure ,this solves your problem .
http://abstractvb.com/code.asp?F=11&P=1&A=969
add this to your VB.NET Book
-
Dec 31st, 2002, 11:45 AM
#3
Thread Starter
Hyperactive Member
I've taken this line from it pirate:
VB Code:
rtbcodewindow.LoadFile(Application.StartupPath & "\forms.rtf", RichTextBoxStreamType.RichText)
Hoping that will do it (as they are set files, not chosen by the user) but i'm getting this error:
System.IO.FileNotFoundException' occurred in mscorlib.dll
All i want is to load a specific file into a richtextbox, no filters, no user dialog boxes, no line-splitting, just a straight forward "load this rtf file into this rtb."
-
Dec 31st, 2002, 12:01 PM
#4
Thread Starter
Hyperactive Member
It's ok, its all sorted now, I didn't have the textfiles in the right place (doh!)
-
Dec 31st, 2002, 12:43 PM
#5
-
Dec 31st, 2002, 02:13 PM
#6
-
Dec 31st, 2002, 07:31 PM
#7
PowerPoster
Great tip MrPolite. I have never seen that before. Thanks
-
Dec 31st, 2002, 08:04 PM
#8
Originally posted by hellswraith
Great tip MrPolite. I have never seen that before. Thanks
hehe, same with app.path in vb6
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 1st, 2003, 06:42 AM
#9
Thread Starter
Hyperactive Member
-
Jan 1st, 2003, 03:04 PM
#10
Happy new year! 
can I tell you how to do what? use that path.combine? hmm
well you could do something like this:
VB Code:
Dim docPath As String = IO.Path.Combine(Application.StartupPath,"forms.rtf")
rtbcodewindow.LoadFile(docPath, RichTextBoxStreamType.RichText)
btw I havent tested that code, hope it works
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jan 4th, 2003, 08:05 AM
#11
Thread Starter
Hyperactive Member
Works a treat Mr Polite
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
|