Public Class Form1
Dim week(0 To 6) As String
Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
week(0) = "Monday"
week(1) = "Tuesday"
week(2) = "Wednesday"
week(3) = "Thursday"
week(4) = "Friday"
week(5) = "Saturday"
week(6) = "Sunday"
For Each day As String In week
MsgBox(day)
Next
End Sub
End Class
2. Adding Users
Public Class Form1
Dim Users As New Hashtable
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Users.Add("FirstName", txtFirstName.Text)
Users.Add("LastName", txtLastName.Text)
Users.Add("EMail", txtEMail.Text)
txtEMail.Clear()
txtFirstName.Clear()
txtLastName.Clear()
End Sub
Private Sub btnFirstName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirstName.Click
MsgBox(Users.Item("FirstName"))
End Sub
Private Sub bntLastName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntLastName.Click
MsgBox(Users.Item("LastName"))
End Sub
Private Sub btnEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmail.Click
MsgBox(Users.Item("EMail"))
End Sub
End Class
3. Printer Queue
Public Class Form
Dim joblist As New Queue
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim jobs As New Hashtable
jobs.Add("Job Title", txtTitle.Text)
jobs.Add("Page Quantity", NumericUpDown1.Value)
joblist.Enqueue(jobs)
For Each h As Hashtable In joblist
lstJobs.Items.Add("(" & h.Item("Page Quantity") & ")" & h.Item("Job Title"))
Next
jobs.Clear()
joblist.Clear()
txtTitle.Clear()
NumericUpDown1.Value = 1
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
lstJobs.Items.Clear()
End Sub
End Class
No comments:
Post a Comment