0% found this document useful (0 votes)
37 views2 pages

My Form 1 Code For Assignment (Draft)

The document is a Visual Basic code for a form that allows users to select input methods for sorting and searching algorithms. It includes options for random numbers or an external text file, and displays appropriate UI elements based on user selections. The code also handles file selection and reading, displaying an error message if the file does not exist.

Uploaded by

myatminkhant5599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

My Form 1 Code For Assignment (Draft)

The document is a Visual Basic code for a form that allows users to select input methods for sorting and searching algorithms. It includes options for random numbers or an external text file, and displays appropriate UI elements based on user selections. The code also handles file selection and reading, displaying an error message if the file does not exist.

Uploaded by

myatminkhant5599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Imports System.

IO

Public Class frm1

Private Sub cmdSelect_Click(sender As Object, e As EventArgs) Handles


[Link]
If [Link] = False And [Link] = False And
[Link] = False And [Link] = False Then
MsgBox("Please choose one input method.")
Return
End If
If [Link] = False And [Link] = False
Then
MsgBox("Please choose one input method.")
Return
End If
If [Link] = True Then
[Link] = True
[Link] = False
ElseIf [Link] = True Then
[Link] = True
[Link] = False
End If
End Sub

Private Sub cmdChoose_Click(sender As Object, e As EventArgs) Handles


[Link]

Dim myReader As StreamReader


Dim dialog As OpenFileDialog
Dim selected As Boolean
Dim filename As String

dialog = New OpenFileDialog

selected = [Link]

If selected = True Then


filename = [Link]
If [Link](filename) Then
myReader = [Link](filename)
[Link] = [Link]
[Link] = filename
Else
MsgBox("No such file.")
End If

End If

[Link] = True
End Sub

Private Sub cmdNext_Click(sender As Object, e As EventArgs) Handles


[Link]
[Link]()
[Link] = False
End Sub

Private Sub frm1_Load(sender As Object, e As EventArgs) Handles [Link]


[Link] = False
[Link] = False
End Sub
End Class

You might also like