Re: RichTextBox issue

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



David,
There is not much to post, I drop the RTB onto a form, set the
"EnableAutoDragDrop" to true. I added a few lines to write to a file.
Interestingly, if you open the created myfile.rtf with wordpad, it also
shows no file names BUT if you create the myfile.rtf with wordpad, drag
files into it, then open with the following code, the file names are shown!
Dumbfounded,
Bob

Public Class Form1
Private Sub ReadButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ReadButton.Click
Try
RichTextBox1.LoadFile("c:\myfile.rtf")
Catch ex As Exception
Beep()
End Try
End Sub

Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SaveButton.Click
Try
RichTextBox1.SaveFile("c:\myfile.rtf")
Catch ex As Exception
Beep()
End Try
End Sub
End Class


"dotNetDave" <dotNetDave@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5C5287B0-5FF2-4DAA-8722-7CD88D5B6829@xxxxxxxxxxxxxxxx
Can you please post your code? It sounds like you are not calling your
object
correctly.

David


======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''s .NET Coding Standards available at:
http://codingstandards.notlong.com


"Bob" wrote:

If one drops a file, say a text file onto a richtextbox, the file name
does
not appear, only the file type.
Is there a setting I'm missing or is it just a richtextbox thing?

thanks
Bob





.



Relevant Pages

  • Re: BindingSource.EndEdit - Not updating underlying data source
    ... Const SaveButtonText As String = "Save Zone" ... Catch ex As Exception ... Private Sub frmZones_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing ...
    (microsoft.public.dotnet.framework.adonet)
  • aboutbox
    ... Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click ... Catch ex As Exception ... Dim myAboutDialog As New AboutBox1 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: multithreading problem in winforms
    ... Private Sub tspProgress_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tspProgress.VisibleChanged ... If (Not workingThread Is Nothing AndAlso workingThread.IsAlive) Then ... Catch ex As Exception ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Application.ThreadException/Enable JIT debugging
    ... Public Class Form1 ... Private Sub MYThreadHandler(ByVal sender As Object, ... Catch ex As Exception ...
    (microsoft.public.dotnet.languages.vb)
  • Irgendwie hängt hier was(Grafik)
    ... ich habe ein UserControl, dass ich dreimal instanziere. ... Public Event X_Changed(ByVal sender As Object, ... Private myZ As Single ... Private Sub FRM_XYZ_MouseMove(ByVal sender As Object, ...
    (microsoft.public.de.german.entwickler.dotnet.vb)