![](/img/trans.png)
[英]vb.net - How to get value from each line in richtextbox and show each values into textboxes
[英]Vb.net Get the text from Textbox inserted line by line in other Textboxes
我制作了一个主页程序,使用户可以将文本插入文本框,然后将其保存为文本文件。 现在,我想让用户可以将文件中的值读回到“文本”框中。 我虽然想将整个文本导入一个大的多行文本框(我称其为“ mothertext”),然后从那里将其导入其他文本框。
textbox1.text = mothertext.text.line (1)
textbox2.text = mothertext.text.line (2)
textbox3.text = mothertext.text.line (3)
有没有一种可行的方法或类似的方法? 非常感谢您能帮我的忙:)
“Fürspäterspeichern” =保存以供以后编辑
“Öffnen” =打开(* .txt文件)
多数民众赞成在最后一个功能,似乎很容易,但是...是的
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
Static count As Integer
count = count + 1
OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog1.Filter = "All Files (*.*)|*.*|Excel files (*.xlsx)|*.xlsx|CSV Files (*.csv)|*.csv|XLS Files (*.xls)|*xls"
If (OpenFileDialog1.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
Dim read As IO.StreamReader
read = IO.File.OpenText(OpenFileDialog1.FileName)
TextBox17.Text = read.ReadToEnd()
read.Close()
Dim readLines() As String = IO.File.ReadAllLines(OpenFileDialog1.FileName)
TextBox1.Text = readLines(0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.