Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class frmBloodPressureReport
- Public Shared intNumberOfPatient As Integer = 16
- Public Shared strPatientName(intNumberOfPatient) As String
- Private intBloodPressure(intNumberOfPatient) As Integer
- Private Sub frmBloodPressureReport_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
- Dim objReader As IO.StreamReader
- Dim strLocationAndNameOfFile As String = "C:\patient.txt"
- Dim intCount As Integer = 0
- Dim intFill As Integer
- If IO.File.Exists(strLocationAndNameOfFile) Then
- objReader = IO.File.OpenText(strLocationAndNameOfFile)
- Do While objReader.Peek <> -1
- strPatientName(intCount) = objReader.ReadLine()
- intBloodPressure(intCount) = Convert.ToInt32(objReader.ReadLine())
- 'Debugging
- Console.WriteLine(strPatientName(intCount))
- Console.WriteLine(intBloodPressure(intCount))
- Loop
- objReader.Close()
- For intFill = 0 To (strPatientName.Length - 1)
- 'lstPatientName.Items.Add(strPatientName(intCount))
- lstPatientName.Items.Add(strPatientName(intFill))
- Next
- Else
- MsgBox("The file is not available. Restart the program when the file is available",, "Error")
- Close()
- End If
- End Sub
- Private Sub mnuExit_Click(sender As Object, e As EventArgs) Handles mnuExit.Click
- 'The mnuExit click event closes the application
- Application.Exit()
- End Sub
- Private Sub mnuDisplay_Click(sender As Object, e As EventArgs) Handles mnuDisplay.Click
- 'The mnuDisplay click event creates an instance of the frmDisplayPatient
- Dim frmSecond As New frmDisplayPatient
- 'Hide this form and show the Display Patient Information
- Hide()
- frmSecond.ShowDialog()
- End Sub
- Private Sub btnPatientCheck_Click(sender As Object, e As EventArgs) Handles btnPatientCheck.Click
- lblConsultDocument.Visible = True
- End Sub
- Private Sub mnuClear_Click(sender As Object, e As EventArgs) Handles mnuClear.Click
- lstPatientName.Items.Clear()
- lblConsultDocument.Visible = False
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement