Richtextbox wont save...

bjwade62

Well-known member
Joined
May 25, 2006
Messages
50
Programming Experience
3-5
The Richtextbox wont save if it's not visible. Why Not? It did in VB6. Can anyone help me?

Thanks,
Bernie
mad.gif
 
A very wild guess is that you ask about the SaveFile method of RichTextBox, and this doesn't work when RTB:Visible=False. Still you may access the properties and get the text and save it to a file. Did you try to use context menu in code view, the 'insert snippet' lets you browse and insert simple code snippets like the one liner to write text to file:
VB.NET:
My.Computer.FileSystem.WriteAllText("rtb.txt", RichTextBox1.Text, True)
 
As an added peculiarity, if you create a new RichTextBox instance in memory, without even adding it to the form its SaveFile method does work as normal. Funny, eh? ;)
 
Back
Top