1.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str() As String = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}
For Each s As String In str
MsgBox(s)
Next
End Sub
End Class
2.
Public Class btnFirst
Dim info As New Hashtable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
info.Clear()
info.Add("First Name", txtFirst.Text)
info.Add("Last Name", txtLast.Text)
info.Add("E-mail", txtMail.Text)
txtFirst.Clear()
txtLast.Clear()
txtMail.Clear()
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(info.Item("First Name"))
End Sub
Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
MsgBox(info.Item("Last Name"))
End Sub
Private Sub btnMail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMail.Click
MsgBox(info.Item("E-mail"))
End Sub
End Class
3.
Public Class frmPrinter
Dim print As New Queue
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim page As New Hashtable
page.Add("Title", txtTitle.Text)
page.Add("Pages", txtPages.Text)
print.Enqueue(page)
refreshJobs()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
print.Dequeue()
refreshJobs()
End Sub
Private Sub refreshJobs()
lstQueue.Items.Clear()
For Each d As Hashtable In print
lstQueue.Items.Add(d.Item("Pages") & (" ") & d.Item("Title"))
Next
End Sub
End Class