473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

RichTextBox.SaveFile Problem

Hi
I have a Dialog Form with a RichTextBox control

** code ***
Dim f As New dlgForm()
If f.ShowDialog() = DialogResult.OK Then
f.RichTextBox1.SaveFile("c:\arq1.rtf") 'error here
End If
** end code ***

If I run the aplication I get a error:
"Object reference not set to an instance of an object."

but...

If I debug/step by step everything works fine

am I doing somthing wrong?
how to prevent this?

Thanks a lot
Marcos
Nov 20 '05 #1
5 3540
* "Marcos Ribeiro" <ki**@barretos.com.br> scripsit:
Hi
I have a Dialog Form with a RichTextBox control

** code ***
Dim f As New dlgForm()
If f.ShowDialog() = DialogResult.OK Then
f.RichTextBox1.SaveFile("c:\arq1.rtf") 'error here
End If
** end code ***

If I run the aplication I get a error:
"Object reference not set to an instance of an object."

but...

If I debug/step by step everything works fine


Seems to be a similar issue/bug like this (in German):

<http://groups.google.de/groups?selm=bn328t%24s9n67%242%40ID-208219.news.uni-berlin.de>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Cor
Hi Herfried,

How did you know that Marcos could speak German,

Seems to be a similar issue/bug like this (in German):

<http://groups.google.de/groups?selm=...08219.news.uni
-berlin.de>
--


I see he can English and Portugese, but German, very good that you see that
with so few information. And it is not the most simple German on that page.

But it is I understand that it is (after some more testing) because it is
that the richtextbox is never been visible on form.
I tested it also in this situation, and I think also that it is a bug.

\\\
'the richtextbox.visible on form1 is set to false
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim f As New Form2
If f.ShowDialog() = DialogResult.OK Then
Dim a As New RichTextBox
RichTextBox1.Text = f.RichTextBox1.Text
End If

RichTextBox1.Visible = True
' with this not set there is an error (also in the debugger)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
RichTextBox1.SaveFile("c:\test1\arq4.rtf")
End Sub
///

Cor
Nov 20 '05 #3
* "Cor" <no*@non.com> scripsit:
How did you know that Marcos could speak German,
LOL -- I know that he most likely won't speak German, I only wanted to
point out that there are similar issues.
<http://groups.google.de/groups?selm=...08219.news.uni
-berlin.de>

But it is I understand that it is (after some more testing) because it is
that the richtextbox is never been visible on form.
I tested it also in this situation, and I think also that it is a bug.


Thank you for testing and sharing the results!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
LOL
Actually I dont speak German (I barely speak english)
As a relief (or not), it's good to know that i was'nt doing anything wrong
I mannaged it saving on the dialog.close event and then retriving it on the
parent form
Thanks ayway
Marcos

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> escreveu na mensagem
news:eh**************@tk2msftngp13.phx.gbl...
* "Cor" <no*@non.com> scripsit:
How did you know that Marcos could speak German,


LOL -- I know that he most likely won't speak German, I only wanted to
point out that there are similar issues.
<http://groups.google.de/groups?selm=...08219.news.uni -berlin.de>

But it is I understand that it is (after some more testing) because it is that the richtextbox is never been visible on form.
I tested it also in this situation, and I think also that it is a bug.


Thank you for testing and sharing the results!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
* "Marcos Ribeiro" <ki**@barretos.com.br> scripsit:
Actually I dont speak German (I barely speak english)
As a relief (or not), it's good to know that i was'nt doing anything wrong


That was the intention of my post (I didn't expect you to understand the
text on the German language pages).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: nouno | last post by:
I am trying to spell check a richtextbox. Through code (shown below) I save the contents of the richtextbox to a rtf file, open the rtf file in Word, spell check it, save it, and then load the ftf...
1
by: Yuelin | last post by:
Hi there How can I read a RTF file into a RichTextBox control without the original format being lost? And how can I save the text entered in a RichTextBox into a RTF file without the original...
0
by: y2k692hu | last post by:
Hello I am trying to run this and I keep getting a "SystemNullReferenceException: Object reference not set to instance of an object" error. I have three menu items bold, italic and underline. When i...
1
by: tulasi | last post by:
I am placing textbox controls and combo box controls on richtext box and 2 command buttons on form control. after executing the application i'll place some text into textbox controls and select a...
0
by: AxOn | last post by:
Hi! I'm having trouble creating a save funktion. How can I save the contens of a new richTextBox that is created from an "external" class file? The open funktion looks like this: public void...
3
by: AxOn | last post by:
Hi, I have an application with a Save function. I want to be able to have several tabs(each containing a RichTextBox, created at runtime) open in a tabControl and save the text from each...
0
by: talon83 | last post by:
Ok, I am wondering how do I set the amount of characters per line that a richtextbox will have. I have a save dialog code and i want to set the characters to 64 characters then goto another line and...
0
by: Morrigan | last post by:
Hello, I am using the following code to add text to a RichTextBox: rtfLog.AppendText("File not Found: " & MyPath & MySubPath & "\" & ArtikelTempStr & ".pdf" & Chr(10)): Next step is to save...
4
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a multiline RichTextBox that I use for data logging. I'm concerned about how the AppendText method reacts when over time the maximum number of characters have been added. Do the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.