RichTextBox.SaveFile Problem

  • Thread starter Thread starter Marcos Ribeiro
  • Start date Start date
M

Marcos Ribeiro

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
 
* "Marcos Ribeiro said:
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/[email protected]>
 
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/[email protected]
-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
 
* "Cor said:
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/[email protected]
-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!
 
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
 
* "Marcos Ribeiro said:
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).
 
Back
Top