bt.ionut Posted September 18, 2012 Report Posted September 18, 2012 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 SubEnd Class1.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. Quote
Slice228 Posted September 18, 2012 Report Posted September 18, 2012 (edited) Ma bag putin la a 2-a intrebare, cu toate ca nu ma prea stiu: If ProgressBar1.Value = 100 then MessageBox.Show("text") EndIfSa ma corecteze cineva daca e gresit, am precizat ca nu ma prea stiu(am cam uitat). Edited September 18, 2012 by Slice228 Quote
bc-vnt Posted September 18, 2012 Report Posted September 18, 2012 If ProgressBar1.Value < 100 Then ProgressBar1.Value += 1 ElseIf ProgressBar1.Value = ProgressBar1.Maximum Then Timer1.Stop() MsgBox("Finish") End If Quote
M2G Posted September 19, 2012 Report Posted September 19, 2012 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) ThengenerateKey()msgbox1.show("key generated")End Ifprivate 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 Selectend sub Quote
bt.ionut Posted September 20, 2012 Author Report Posted September 20, 2012 @M2G merci.Multumersc tuturor pentru ajutor. Quote