この Visual Basic プログラムの目的は、ファイルからの入力を保存し、ラベルに出力することです。一度に 1 つの値を表示する必要があります。私の考えは、値をインデックスに保存することですが、それは扱いにくく、機能しません。
このプログラムには、出力のインデックスの値を増減する次と前のボタンがあります。
これは私が使用しているコードです。
Public Sub FileModeButton_Click(sender As System.Object, e As System.EventArgs) Handles FileModeButton.Click
Dim Result As DialogResult = OpenFileDialog.ShowDialog()
If Result = DialogResult.Cancel Then
Return
End If
FileOpen(1, OpenFileDialog.FileName, OpenMode.Input)
Index = 1
Do While Not EOF(1)
'Need to keep more than one stored set of outputs.
Input(1, FileOutput1)
Input(1, FileOutput2)
FileOut1(Index) = FileOutput1
FileOut2(Index) = FileOutput2
Index += 1
Loop
FileClose(1)
End Sub
Private Sub ApplyButton_Click(sender As System.Object, e As System.EventArgs) Handles ApplyButton.Click
Index = 1
If ModeComboBox.Text = "File" Then
FileModeGroupBox.Enabled = True
TextboxModeGroupBox.Enabled = False
Output1Label.Text = FileOut1(Index)
Output2Label.Text = FileOut2(Index)
End If
End Sub