Senin, 25 Januari 2016

MENENTUKAN PERULANGAN

MENENTUKAN PERULANGAN
ASSALAMU'ALAIKUM WARAHMATULLAHI WABAROKATUH :)
 
SELAMAT DATANG DI BLOG SAYA, SAYA AKAN MEMPOSTING MENGENAI  PROGRAM VISUAL BASIC 10 YANG SAYA BUAT

PROJECT LATIHAN 9





BERIKUT CODING MENENTUKAN PERULANGAN
Public Class latihan9
    Dim mulai, akhir As Integer
    Sub hasil()
        Dim ulang As Integer
        mulai = Val(Me.Txtmulai.Text)
        akhir = Val(Me.Txtakhir.Text)

        If mulai > akhir Then
            For ulang = mulai To akhir Step -1
                Me.Lshasil.Items.Add(ulang)

            Next
        Else
            For ulang = mulai To akhir
                Me.Lshasil.Items.Add(ulang)

            Next
        End If


    End Sub

    Private Sub BBaru_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BBaru.Click
        Me.Lshasil.Items.Clear()
        Me.Txtmulai.Text = ""
        Me.Txtakhir.Text = ""
        Me.Txtmulai.Focus()
    End Sub

    Private Sub BProses_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BProses.Click
        Call hasil()
    End Sub

    Private Sub latihan9_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        utama.Enabled = True
        utama.Show()
        Me.Hide()
    End Sub

   
    Private Sub latihan9_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        utama.Enabled = True
        utama.Show()
        Me.Hide()
    End Sub
End Class

Tidak ada komentar:

Posting Komentar