Jump to content
bt.ionut

vb progress bar

Recommended Posts

Posted

am sursa:

Public Class Form1

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Start()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Key As Integer
Key = (Rnd() * 10)

Select Case Key
Case 1
TextBox1.Text = "GJKSA-AGS3-GH3SG-54JH"

Case 2
TextBox1.Text = "H45HD-J5H4D-H4KN6-DJJ4"

Case 3
TextBox1.Text = "MBEGA-GASGA-GASG3-J6J6"

Case 4
TextBox1.Text = "MVHFG-AHDY2-HAYDH2-AHDW"

Case 5
TextBox1.Text = "LAM3J-84JFH-4YS6D-2H282"

Case 6
TextBox1.Text = "MAK2L-DSFAG-WHTOF-WHTS"

Case 7
TextBox1.Text = "LAKFG-WJALS-GWITG-AWFS"

Case 8
TextBox1.Text = "MAK2L-DSFAG-WHTOF-WHTS"

Case 9
TextBox1.Text = "LAM3J-84JFH-4YS6D-2H282"

Case 10
TextBox1.Text = "MBEGA-GASGA-GASG3-J6J6"
End Select
ProgressBar1.Increment(100)
End Sub
End Class

1.Cum fac ca in momentul in care progress bar1 a ajuns la 100% sa imi arate codul(keyul), sursa de mai sus, arata inainte sa ajuga bara la 100%

2. Cum fac cand progress bar1 e 100% sa imi arate un pop-up cu un text.

*Merci.

Posted (edited)

Ma bag putin la a 2-a intrebare, cu toate ca nu ma prea stiu:

 If ProgressBar1.Value = 100 then 
MessageBox.Show("text")
EndIf

Sa ma corecteze cineva daca e gresit, am precizat ca nu ma prea stiu(am cam uitat).

Edited by Slice228
Posted

Stergi codul de la button click si pui verificarea asta.

Daca vrei delay, pui ca dupa ce ai facut click pe buton sa incrementeze valoarea la progress bar la un anumit interval de timp.

De exemplu jumate de secunda dar e cam mult si asa.

if (ProgressBar1.Value == ProgressBar1.Maximum) Then
generateKey()
msgbox1.show("key generated")
End If

private Sub generateKey()
Dim Key As Integer
Key = (Rnd() * 10)

Select Case Key
Case 1
TextBox1.Text = "GJKSA-AGS3-GH3SG-54JH"

Case 2
TextBox1.Text = "H45HD-J5H4D-H4KN6-DJJ4"

Case 3
TextBox1.Text = "MBEGA-GASGA-GASG3-J6J6"

Case 4
TextBox1.Text = "MVHFG-AHDY2-HAYDH2-AHDW"

Case 5
TextBox1.Text = "LAM3J-84JFH-4YS6D-2H282"

Case 6
TextBox1.Text = "MAK2L-DSFAG-WHTOF-WHTS"

Case 7
TextBox1.Text = "LAKFG-WJALS-GWITG-AWFS"

Case 8
TextBox1.Text = "MAK2L-DSFAG-WHTOF-WHTS"

Case 9
TextBox1.Text = "LAM3J-84JFH-4YS6D-2H282"

Case 10
TextBox1.Text = "MBEGA-GASGA-GASG3-J6J6"
End Select
end sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...