Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim sr As IO.StreamReader
Dim category, prompt, title, fileName As String
Dim males, females, perMales, perFemales, total As Double
Dim fmtStr As String = "{0,-10}{1,12:N0}{2,14:N0}{3,12:P2}{4,14:P2}{5,14:P2}"
prompt = "Enter the name of the file you wish to display"
title = "Filename"
fileName = InputBox(prompt, title)
sr = IO.File.OpenText(fileName)
category = sr.ReadLine
males = CDbl(sr.ReadLine)
females = sr.ReadLine
perMales = males / 100115
perFemales = females / 100115
total = 100115 / 287713
'category = sr.ReadLine
'males = sr.ReadLine
'females = sr.ReadLine
'perMales = males / 151228
'perFemales = females / 151228
'total = 151228 / 287713
'category = sr.ReadLine
'males = sr.ReadLine
'females = sr.ReadLine
'perMales = males / 36370
'perFemales = females / 36370
'total = 36370 / 287713
sr.Close()
With lstGender.Items
.Add(String.Format(fmtStr, category, males, females, perMales, perFemales, total))
.Add(String.Format(fmtStr, category, males, females, perMales, perFemales, total))
.Add(String.Format(fmtStr, category, males, females, perMales, perFemales, total))
End With
End Sub
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Close()
End Sub
End Class