|
-
Jul 17th, 2003, 07:24 PM
#1
Opening Files into child window textbox
I get this error
Additional information: Invalid file format.
I am using this code
VB Code:
If OpenFileDialog.ShowDialog() = DialogResult.OK Then
Dim Child As frmChild
Child = New frmChild
Child.MdiParent = Me
Child.Show()
Child.ActiveForm.Text = OpenFileDialog.FileName
Child.txtBoxChild.LoadFile(OpenFileDialog.FileName)
End If
What's wrong?
-
Jul 18th, 2003, 02:29 AM
#2
Fanatic Member
what fileformat are you trying to open inth textbox. I understand you try to open a format that is not supported
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
Jul 18th, 2003, 04:34 PM
#3
Originally posted by robbedaya
what fileformat are you trying to open inth textbox. I understand you try to open a format that is not supported
I'm just trying to open a plain ole text file into a rich text box...
-
Jul 18th, 2003, 05:01 PM
#4
you are missing a vital bit in the LoadFile of the richtextbox :
VB Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim od As New OpenFileDialog()
od.InitialDirectory = "C:\"
If od.ShowDialog = DialogResult.OK Then
RichTextBox1.LoadFile(od.FileName, RichTextBoxStreamType.PlainText)
End If
End Sub
RichTextBoxStreamType.PlainText
^^^ being the bit.
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 18th, 2003, 11:18 PM
#5
Thanks, that works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|