早上好。
我一直在努力。但我到了最后。我需要在周日的课程上提交这个。
我有一个按钮将我的数据发送到USB驱动器,我需要将它发送到第二个表单上的列表。我如何通过它。
这就是我所拥有的:
Private Sub btnTestResults_Click(sender As Object, e As EventArgs) Handles btnTestResults.Click
' Sends data to the frmresults form three, and creates the "consult.txt file on a
' USB drive for the Nurse can contact the patients.
Dim objWriter As New IO.StreamWriter("e:\consult.txt")
Dim frmThird As New frmElevatedResults
Dim intHighCholesterol As Integer = 200I
' Write the file line by line until the file is completed.
If IO.File.Exists("e:\consult.txt") Then
If _intCholesterolLevel(intCount) < intHighCholesterol Then
objWriter.WriteLine(_strNames(intCount))
objWriter.WriteLine(_intCholesterolLevel(intCount))
Else
MsgBox("The file is not available.
Please restart the program when the file is available", , "Error")
objWriter.Close()
End If
End If
Hide()
frmThird.ShowDialog()
End Sub
非常感谢
答案 0 :(得分:0)
一种选择是在frmElevatedResults
上公开列表框:
frmElevatedResults
(如果尚未完成)。Show all Files
。frmElevatedResults.Designer.vb
listBox1 as ListBox
public listBox1 as ListBox
(我会包括屏幕,但我的VS不是英文)。
在您的第一张表格上,您现在可以使用:
Dim frmThird As New frmElevatedResults
...
frmThird.listBox1.Items.Add(string.concat(_strNames(intCount),
" - ",
_intCholesterolLevel(intCount))
...
Hide()
frmThird.Show()
或者你想放在那里的任何东西。