Selasa, 21 April 2015

Progress Bar Copy Dengan Visual Basic 2010



Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()

        TextBox1.Text = OpenFileDialog1.FileName
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        SaveFileDialog1.ShowDialog()
        TextBox2.Text = SaveFileDialog1.FileName
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If ((TextBox1.Text.Trim <> "") Or (TextBox2.Text.Trim <> "")) Then
            FileCopy(TextBox1.Text, TextBox2.Text)
            Dim a As Single
            Do
                a += 1
                ProgressBar1.Increment(a)
            Loop Until a = 100

            MessageBox.Show("File berhasil dicopy", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
       
        Label3.Text = "LOADING.."
        Label4.Text = 1
        Label5.Text = "%"
        Timer1.Enabled = True

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
       
    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: