0% found this document useful (0 votes)
10 views

My Form 1 Code For Assignment (Draft)

Uploaded by

myatminkhant5599
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

My Form 1 Code For Assignment (Draft)

Uploaded by

myatminkhant5599
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Imports System.

IO

Public Class frm1

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


cmdSelect.Click
If optBubblesort.Checked = False And optBinarysearch.Checked = False And
optBubblesort.Checked = False And optInsertionsort.Checked = False Then
MsgBox("Please choose one input method.")
Return
End If
If optRandomnumber.Checked = False And optExternaltextfile.Checked = False
Then
MsgBox("Please choose one input method.")
Return
End If
If optRandomnumber.Checked = True Then
cmdNext.Visible = True
GroupBox3.Visible = False
ElseIf optExternaltextfile.Checked = True Then
GroupBox3.Visible = True
cmdNext.Visible = False
End If
End Sub

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


cmdChoose.Click

Dim myReader As StreamReader


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

dialog = New OpenFileDialog

selected = dialog.ShowDialog

If selected = True Then


filename = dialog.FileName
If File.Exists(filename) Then
myReader = File.OpenText(filename)
txtData.Text = myReader.ReadToEnd
txtData.Text = filename
Else
MsgBox("No such file.")
End If

End If

cmdNext.Visible = True
End Sub

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


cmdNext.Click
frm2.Show()
Me.Visible = False
End Sub

Private Sub frm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


cmdNext.Visible = False
GroupBox3.Visible = False
End Sub
End Class

You might also like