Returns whole lines, the odd occasion a word. any thing obvious wrong?
Not sure if i am being slow this early in the morning
VB.NET:
Private _word As String()
Private _i As New Random
Private Sub btnGetNewhangManWord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnGetNewhangManWord.Click
If _word Is Nothing Then
MessageBox.Show(NoFileSelected, Application.ProductName)
Exit Sub
End If
Dim index As Integer = _i.Next(1, _word.Length)
Dim word As String = _word(index)
txtHangManSelection.Text = word
End Sub
Private Sub btnLoadNewHangManChoices_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnLoadNewHangManChoices.Click
' (ident) Create an instance of the open file dialog box.
Dim ofdFileDialog As OpenFileDialog = New OpenFileDialog
' (ident) Set filter options and filter index.
ofdFileDialog.Filter = FileDialogFilter
ofdFileDialog.FilterIndex = 1
If ofdFileDialog.ShowDialog() = DialogResult.OK Then
' (ident) File selected so save it's contents.
_word = IO.File.ReadAllLines(ofdFileDialog.FileName)
Exit Sub
End If
MessageBox.Show(NoFileSelected, Application.ProductName)
End Sub
Not sure if i am being slow this early in the morning