Jump to content


Photo

Vb 6 - Como Parar O Codigo?


  • Faça o login para participar
8 replies to this topic

#1 lsfranc

lsfranc

    Novato no fórum

  • Usuários
  • 2 posts
  • Sexo:Não informado

Posted 05/09/2008, 11:43

Alguem sabe como parar o codigo no VB ? Sei que a funçao stop para o programa mesmo. É que estou com um problema:

Private Sub CommandButton2_Click()
End
End Sub

Private Sub Frame1_Click()

End Sub

Private Sub opt_4_Click()

End Sub

Private Sub pergunta_seguinte_Click()

If lbl_numero.Caption = 1 Then
If opt_3.Value Then
MsgBox ("certo")
'Mostra no numero da pergunta!
lbl_numero.Caption = lbl_numero.Caption + 1
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)
opt_1.Value = False
opt_2.Value = False
opt_3.Value = False
opt_4.Value = False
End If
Else
MsgBox ("errado")
'Mostra no numero da pergunta!
'lbl_numero.Caption = lbl_numero.Caption
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)

End If



If lbl_numero.Caption = 2 Then
If opt_2.Value Then
MsgBox ("certo")
'Mostra no numero da pergunta!
lbl_numero.Caption = lbl_numero.Caption + 1
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)
opt_1.Value = False
opt_2.Value = False
opt_3.Value = False
opt_4.Value = False
End If

End If

If lbl_numero.Caption = 3 Then
If opt_3.Value Then
MsgBox ("certo")
Else
MsgBox ("errado")
'Mostra no numero da pergunta!
'lbl_numero.Caption = lbl_numero.Caption
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)

End If

End If
If lbl_numero.Caption = 4 Then
If opt_4.Value Then
MsgBox ("certo")
Else
MsgBox ("errado")
'Mostra no numero da pergunta!
'lbl_numero.Caption = lbl_numero.Caption
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)

End If
End If
If lbl_numero.Caption = 5 Then
If opt_4.Value Then
MsgBox ("certo")
Else
MsgBox ("errado")
'Mostra no numero da pergunta!
'lbl_numero.Caption = lbl_numero.Caption
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)

End If
End If

If lbl_numero.Caption = 6 Then
If opt_3.Value Then
MsgBox ("certo")
Else
MsgBox ("errado")
'Mostra no numero da pergunta!
'lbl_numero.Caption = lbl_numero.Caption
x = lbl_numero.Caption
'Mostrar a descricao da pergunta!'
lbl_pergunta.Caption = Sheets(5).Cells(x, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(x, 2))
'mostrar As Respostas
opt_1.Caption = Sheets(6).Cells(x, 1)
opt_2.Caption = Sheets(6).Cells(x, 2)
opt_3.Caption = Sheets(6).Cells(x, 3)
opt_4.Caption = Sheets(6).Cells(x, 4)

End If
End If


''If opt_1.Value = False And opt_2.Value = False And opt_3.Value = False And opt_4.Value = False Then
''MsgBox ("Tem de escolher uma resposta! O jogo vai fechar.")
''End
''End If


If lbl_numero.Caption >= 6 Then
MsgBox "Esta é a última pergunta !"
pergunta_seguinte.Enabled = False
End If

End Sub

Private Sub UserForm_Initialize()
'Mostra no numero da pergunta!
lbl_numero.Caption = 1
'Mostrar a descricao da pergunta!
lbl_pergunta.Caption = Sheets(5).Cells(1, 1)
'mostra a imagem
img_pergunta.Picture = LoadPicture(Workbooks(1).Path & "\tecnologia\" & Cells(1, 2))
'mostrar as Respostas!
opt_1.Caption = Sheets(6).Cells(1, 1)
opt_2.Caption = Sheets(6).Cells(1, 2)
opt_3.Caption = Sheets(6).Cells(1, 3)
opt_4.Caption = Sheets(6).Cells(1, 4)

End Sub


...na primeira pergunta quando respondo errado nao aparece a msgbox a dizer "errado" mas se respondo certo esta tudo bem. Na 2a pergunta se respondo certo aparece errado -> certo -> errado, ou seja, surgem em cadeia. Como posso travar isto ?

cumps

#2 Dough

Dough

    Novato no fórum

  • Usuários
  • 21 posts
  • Sexo:Masculino
  • Localidade:Rio de Janeiro

Posted 15/01/2011, 19:52

Não entendi mutio seu código, mas acho que o comando "Return" ajudará muito
Posted Image Meu post lhe ajudou? Retribuir é uma das formas de agradecer. Não mata ninguém! Só clicar no botão...

#3 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 17/09/2017, 12:25

Levitra Prix En Pharmacie Viagra cialis Ordina Levitra
Atenolol And Amoxicillin
Vipps Pharmacy Selling Viagra <a href=http://cialtobuy.com>cialis</a> Xtane
Stendra cialis Priligy Tratamiento
Buy Super Viagra Prorium
Cialis Kaufen Forum <a href=http://cialtobuy.com>online pharmacy</a> Buy Cialis 20mg Europe
Want To Buy Macrobid 100mg Free Shipping cialis Fluoxetine Overnight Shipping Medicine Remoxy Amoxicillin Bangledesh The Pharmacy Shop Viagra Comment Prendre Cytotec Amoxil Side Affects cialis buy online Viagra On Line
5mg Cialis Online Canada cialis price Buying Clobetasol Drugs
Viagra No Hace Efecto Canadian Online Pharmacies Cheap
Generika Cialis Und Viagra <a href=http://cialtobuy.com>cialis</a> Propecia Tabletas

#4 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 21/09/2017, 08:12

Pyridium In Internet Worldwide Low Price With Free Shipping generic cialis Cialis Meilleur Prix
Citralapram 10mg For Sale Intolerance To Amoxil Antibiotics Cialis Y Fertilidad
Amoxicillin Pre Med Dental cialis buy online Buy Cipro No Prescription

#5 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 12/10/2017, 20:57

Propecia Hair Canada Prescriptions No online pharmacy Can You Drink Alchol Wiht Amoxicillin Cialis Dolores Musculares
Want To Buy Fedex Shipping Clobetasol Temovate Mastercard buy viagra Propecia Colesterol

#6 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 31/10/2017, 02:43

Ventolin Canada Amoxicillin Clavu 875 Levitra Avec Ordonnance online pharmacy Generic Viagra Online Canadian Pharmacy
Prix Kamagra 10 Mg Clomid Jeux De Cartes viagra online Levitra Quante Ore Dura Zithromax 250
Siti Sicuri Per Acquistare Cialis Generico cheap cialis Propecia No Script Il Farmacista Online Cialis Canada
Amoxil For H Pylori Clomid Apres 10 Jours viagra Zithromax Rash Reaction Cialis Vendita Svizzera Ofloxacin Vs Ciprofloxacin

#7 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 07/11/2017, 13:24

Extra Super Levitra Frumforum.Co Prescriptions For Cialis cheapest levitra 20mg Buy The Bluepill Amoxicillin Feline Dosage
Acheter Propecia Viagra Venta Sin Receta levitra 40 mg best price Cialis 5 Mg Confezione Finistride 5mg Without Pescription Viagra Prices Cvs

#8 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 08/11/2017, 23:59

Cheap Generic Bentyl Need In Internet Canadian Rx Pharmacy Nexium 40 Mg Online viagra cialis Prix Cialis Soft
Nolvadex Vidal Cialis Belgique Prix viagra online Cout Levitra 10 Failure To Refrigerate Amoxicillin Discount Clobetasol No Prescription Needed Saturday Delivery Shop

#9 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 16/11/2017, 21:51

Cialis Originale Vendita online pharmacy Amoxicillin 500mg Capsule
Amoxicillin And Sandoz Aromadex Levitra Zapfchen viagra Amoxicillin And Dosage Free Levitra.Com
Propecia To Regrow Eyebrows cialis buy online Nsu Treatment Antibiotic Azithromycin Cialis Viagra Cual Mejor
Prix Du Tadalis Sx Soft En Pharmacie For Sale Isotretinoin Acutane Pills Pharmacy With Free Shipping generic viagra Need Generic Direct Progesterone Discount Ups Store Amex Levitra Italia




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq