【发布时间】:2014-11-30 02:03:38
【问题描述】:
我已经在文本编辑器上工作了一段时间,接近完成终于决定开始研究这个问题,这个问题困扰了我很长一段时间......
我有一个 openfiledialog 总是给我“文件格式无效”的错误
Private Sub OpenToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Dim openWork As New OpenFileDialog
openWork.Filter = "Text Documents (*.swtf)|*.swtf|Text Documents (*.rtf)|*.rtf|All Files (*.*)|*.*"
If openWork.ShowDialog = Windows.Forms.DialogResult.OK Then
RichTextBox1.LoadFile(openWork.FileName, RichTextBoxStreamType.RichText)
Title.Text = System.IO.Path.GetFileNameWithoutExtension(openWork.FileName)
End If
End Sub
错误 RichTextBox1.LoadFile(openWork.FileName, RichTextBoxStreamType.RichText) 没有解决方案,但总是给我“文件格式无效”错误 - 包括我的自定义文件扩展名和 .rtf“富文本文件”扩展名.
谢谢!
【问题讨论】:
标签: vb.net richtextbox openfiledialog rich-text-editor