Below is the code I have but I can't figure out for to make the patient.txt(at the bottom of the question) to show up in
Below is the code I have but I can't figure out for to make the patient.txt(at the bottom of the question) to show up in my second windows form frmDisplayReports in the lstReports (code is listed under the patient.txt information). Below is the requirements i am trying to achieve.
4. The patient names and systolic blood pressure levels are assigned to an array that holds 16 elements each.
5. Blood pressure systolic levels are tested to check whether the systolic number is above the value 120.
6. All patients who have a systolic level above 120 have their names and systolic results written to a text file named consult.txt on the USB drive. A nurse will contact these patients for further evaluation.
7. The program displays the number of patients who had a systolic level above 120 and the average systolic value of todays patients.
First form code:
Public Class frmBloodPressure
' Class Level Private variables
Private Sub mnuDisplay_Click(sender As Object, e As EventArgs) Handles mnuDisplay.Click Dim frmSecond As New frmDisplayReports
' Hides this form and displays Display Reports Form. Hide() frmSecond.ShowDialog()
End Sub
Private Sub mnuExit_Click(sender As Object, e As EventArgs) Handles mnuExit.Click ' The mnuExit click event closes the window and exits the application
Close() End Sub
Private Sub mnuClear_Click(sender As Object, e As EventArgs) Handles mnuClear.Click
End Sub
Private Sub frmBloodPressure_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Initialize and instance of StreamReader object
Dim objReader As IO.StreamReader Dim intCount As Integer
If IO.File.Exists("c:\patient.txt") = True Then objReader = IO.File.OpenText("c:\patient.txt") Else MsgBox("The file is not available. Restart the program when the file is available",, "Error") Close() End If
End Sub
Private Sub lblBloodPressureReport_Click(sender As Object, e As EventArgs) Handles lblBloodPressureReport.Click
End Sub End Class
patient.txt
Patricks, Timothy 230 Baker, Scott 138 Wheeler, Irene 187 Jones, Beata 110 Lopez, Felix 90 Chan, Su 165 Nakatama, Tong 190 Tirrell, Eric 150 Dunford, Janet 159 Chavez, Ava 278 Terrell, Robert 119 Osborne, Joan 128 King, Diane 210 Paine, Thomas 140 Levine, Otto 95 Honey, BooBoo 200
My second form code:
Public Class frmDisplayReports Private Sub btnReturn_Click(sender As Object, e As EventArgs) Handles btnReturn.Click Dim frmFirst As New frmBloodPressure
' Hides this form and displays Blood Pressure Report. Hide() frmFirst.ShowDialog() End Sub
Private Sub lblDisplayReports_Click(sender As Object, e As EventArgs) Handles lblDisplayReports.Click
End Sub
Private Sub lstReports_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstReports.SelectedIndexChanged
End Sub
Private Sub frmDisplayReports_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub End Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started