Sabtu, 14 Mei 2011

Contoh source program vb.net




Public Class Form1

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call adit()
Call abe()

End Sub
Sub adit()
Dim I As Integer
Dim B As Integer
ListBox1.Items.Clear()
For I = Val(TextBox1.Text) To Val(TextBox2.Text)
If I Mod 5 = 0 Then
ListBox1.Items.Add("&" & I)
B = B + I

End If
Next
TextBox3.Text = B
End Sub

Sub abe()
Dim I As Integer
Dim A As Integer
ListBox2.Items.Clear()
For I = Val(TextBox1.Text) To Val(TextBox2.Text)
If I Mod 1 = 0 And I Mod 5 > 0 Then
ListBox2.Items.Add(I & "%")
A = A + I
End If

Next
TextBox4.Text = A
End Sub




Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class

Tidak ada komentar:

Posting Komentar