Private Sub btnNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNumber.Click
Dim number As Integer = txtNumber.Text
Dim x As Integer = 0
lstNumber.Items.Clear()
For x = 1 To number
lstNumber.Items.Add(x & " item")
Next
End Sub
End Class
2.
Public Class Form1
Private Sub btnTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotal.Click
Dim pay, months, total As Integer
months = 0
total = 0
pay = CInt(txtPay.Text)
Do While total < 10000
total += pay
months += 1
Loop
lblTotal.Text = (months / 12).ToString("f1")
End Sub
End Class
3.
Public Class Form1
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
For x = 1 To 10
For y = 1 To 10
Dim button1 As New Button
button1.Location = New Point(40 * x, 40 * y)
button1.Width = 40
Me.Controls.Add(button1)
button1.Text = x * y
Next
Next
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub
End Class
No comments:
Post a Comment