Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

Execute multiple code

$
0
0
What my problem here is that each time I click Button1 it shows "Please, enter valid entry" and at the same time the progress bar is loading which is not correct. I only want to execute the progressbar IF the Button1 is VALID.


Code:

Public Class Form1

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

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'PASTE from Clipboard:>>
        TextBox1.Text = Clipboard.GetText()
        'Set the Clipboard to some TEXT:>>
        Clipboard.SetText(TextBox1.Text)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If TextBox1.Text.Trim() = "" Then
            MessageBox.Show("Please, enter valid entry!")
        Timer1.Start()
        End If
    End Sub


    Private Sub GroupBox1_Enter(sender As Object, e As EventArgs)

    End Sub

    Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        ProgressBar1.Increment(1)
        If ProgressBar1.Value = ProgressBar1.Maximum Then
            Button2.Enabled = True
        End If
        Label2.Text = ProgressBar1.Value & (" %")
    End Sub
End Class


Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>