level 4
piingw
楼主
Private Sub OpenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenToolStripMenuItem.Click
Dim AllText As String = "", LineofText As String = ""
OpenFileDialog1.Filter = "text files(*.txt)|*.txt"
OpenFileDialog1.ShowDialog() 'display open dialog box
If OpenFileDialog1.FileName <> "" Then
Try 'open file and trap any errors using handler
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
Do Until EOF(1)
LineofText = LineInput(1)
AllText = AllText & LineofText & vbCrLf
Loop
label1.Text = OpenFileDialog1.FileName 'update label
TextBox1.Text = AllText
TextBox1.Enabled = True
TextBox2.Text = AllText
TextBox2.Enabled = True
TextBox3.Text = AllText
TextBox3.Enabled = True
TextBox4.Text = AllText
TextBox4.Enabled = True
OpenToolStripMenuItem.Enabled = False
Catch
MsgBox("ERROR opening file.")
Finally
FileClose(1)
*save的form

*open的form

为什么它会把全部字放在同一个textbox的?
要怎样才可以把它们放在原本的textbox?
求解阿!!!
2012年10月13日 12点10分
1
Dim AllText As String = "", LineofText As String = ""
OpenFileDialog1.Filter = "text files(*.txt)|*.txt"
OpenFileDialog1.ShowDialog() 'display open dialog box
If OpenFileDialog1.FileName <> "" Then
Try 'open file and trap any errors using handler
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
Do Until EOF(1)
LineofText = LineInput(1)
AllText = AllText & LineofText & vbCrLf
Loop
label1.Text = OpenFileDialog1.FileName 'update label
TextBox1.Text = AllText
TextBox1.Enabled = True
TextBox2.Text = AllText
TextBox2.Enabled = True
TextBox3.Text = AllText
TextBox3.Enabled = True
TextBox4.Text = AllText
TextBox4.Enabled = True
OpenToolStripMenuItem.Enabled = False
Catch
MsgBox("ERROR opening file.")
Finally
FileClose(1)
*save的form

*open的form
为什么它会把全部字放在同一个textbox的?要怎样才可以把它们放在原本的textbox?
求解阿!!!