Jump to content
Cor3Quad

[VB] Help

Recommended Posts

Posted

Am urmatorul cod :

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

MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

If MsgBoxResult.Yes Then

ProgressBar1.Increment(1)

Label1.Text = ProgressBar1.Value & ("%")

End If

If ProgressBar1.Value = 100 Then

Me.Close()

End If

End Sub

End Class

Treaba functioneaza in felul urmator , dau click pe un "buton" si trebe sa mi se deschida o fereastra noua sa intrebe ce am scris eu iar daca dau Yes sa porneasca progress bar-u.Problema ii ca imi apare asa :

http://i50.tinypic.com/35lc3y8.jpg

Progress bar-u porneste chiar daca dau Yes sau No si imi apar o mie de ferestre cu intrebarea.Cum rezolv ? :)

Posted

Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

If result = DialogResult.Yes Then

ProgressBar1.Increment(1)

End If

foloseste ce am scris mai sus si o sa mearga

Posted
Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

If result = DialogResult.Yes Then

ProgressBar1.Increment(1)

End If

foloseste ce am scris mai sus si o sa mearga

Nu merge , tot imi apar n ferestre deschide , doar ca acuma nu mai porneste progress bar-u.

//folosesc timer pt progress bar

Posted

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

Timer1.Stop()

Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

If result = DialogResult.Yes Then

ProgressBar1.Increment(1)

Label1.Text = ProgressBar1.Value & ("%")

Timer1.Start()

End If

End Sub

am facut proba si merge ,apare fereastra cu mesajul (una singura) in cazul in care dai pe Yes progressbarul va creste dupa care va aparea un alt message box . Fa o proba

Posted

aaaaaaaa acu' m-am prins tu vrei ca dupa primul yes sa tot progreseze bara de progres fara a-ti aparea un alt messagebox

uite aici ai alt cod :

Dim i As Integer = 0

Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

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

i = 1

If i = 1 = True Then

If result = DialogResult.Yes Then

ProgressBar1.Increment(1)

'Label1.Text = ProgressBar1.Value & ("%")

End If

End If

End Sub

Posted

Asta ii tot codu :

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer1.Start()
End Sub
Dim i As Integer = 0
Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i = 1
If i = 1 = True Then
If result = DialogResult.Yes Then
ProgressBar1.Increment(1)
Label1.Text = ProgressBar1.Value & ("%")
End If
End If
End Sub
End Class

Asa ai zis tu sa fac , nu merge cum vreau eu.Dau Start Debugging imi apare msgbox-u cu "bla bla" , dau Yes/no imi apare programul , dau Start si incepe progress bar-u fara sa mai apara intrebare.Deci codul tau nu face decat sa ma intrebe cand dau 2xclick pe program nu cand dau eu Start.

Posted

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

Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

If result = DialogResult.Yes Then

Timer1.Start()

End If

End Sub

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

ProgressBar1.Increment(1)

' Label1.Text = ProgressBar1.Value & ("%")

End Sub

noh daca nici asta nu face ce vrei atunci is nebun .

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

Dim result = MessageBox.Show("blabla?", "blabla2", MessageBoxButtons.YesNo)

If result = DialogResult.Yes Then

Timer1.Start()

End If

End Sub

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

ProgressBar1.Increment(1)

' Label1.Text = ProgressBar1.Value & ("%")

End Sub

noh daca nici asta nu face ce vrei atunci is nebun .

:))

Asta-i , mersi mult :*

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...