Arkadaşlar bu konumda visual basic 6 ile çoktan seçmeli test yapmayı anlatacağım..
öncelikle heskes visual basic i açsın
ve yeni for olustursunn
içine aşağıdaki nesneleri eklesin...
4 adet Option Button
3 adet Label
1 adet Command Button
nesneleri ister aşağıdaki resimdeki gibi ekleyin isteseniz kafanıza goree
nesnelerimizi ekledikten sonra sıra geldi kodlara..
formun kod penceresini açalım we..
bu KODLARI ekledikten sonraa F5 e basıp projemizi çalıştıralımm..
THE END
öncelikle heskes visual basic i açsın
ve yeni for olustursunn
içine aşağıdaki nesneleri eklesin...
4 adet Option Button
3 adet Label
1 adet Command Button
nesneleri ister aşağıdaki resimdeki gibi ekleyin isteseniz kafanıza goree
nesnelerimizi ekledikten sonra sıra geldi kodlara..
formun kod penceresini açalım we..
Kod:
Dim dogru As Integer
Dim scount As Integer
Dim Soru(4) As String
Dim a(4) As String
Dim b(4) As String
Dim c(4) As String
Dim d(4) As String
Dim Cevap(4) As String '
Private Sub Form_Load()
Label2.Caption = "Aldığınız puan ="
Label3.Caption = ""
Command1.Caption = "ileri"
scount = 0
dogru = 0
Soru(0) = "Turkiyenin baskenti_?"
Soru(1) = "Turkiyenin en buyuk golu_?"
Soru(2) = "Turkiyenin en yuksek dagı"
Soru(3) = "Turkiyenin en buyuk akarsuyu?"
a(0) = "Ankara"
a(1) = "Abant"
a(2) = "Erciyes"
a(3) = "Kızılırmak"
b(0) = "İstanbul"
b(1) = "Van"
b(2) = "Agrı"
b(3) = "Fırat"
c(0) = "Mardin"
c(1) = "Burdur"
c(2) = "Nemrut"
c(3) = "Dicle"
d(0) = "Bursa"
d(1) = "Tuz"
d(2) = "Suphan"
d(3) = "Asi"
Cevap(0) = "Ankara"
Cevap(1) = "Van"
Cevap(2) = "Agrı"
Cevap(3) = "Kızılırmak"
Label1.Caption = Soru(0)
Option1.Caption = a(0)
Option2.Caption = b(0)
Option3.Caption = c(0)
Option4.Caption = d(0)
End Sub
Private Sub Command1_Click()
If Option1.Value = True Then
scevap = Option1.Caption
ElseIf Option2.Value = True Then
scevap = Option2.Caption
ElseIf Option3.Value = True Then
scevap = Option3.Caption
ElseIf Option4.Value = True Then
scevap = Option4.Caption
End If
If scevap = Cevap(scount) Then
dogru = dogru + 1
End If
If scount < 3 Then
scount = scount + 1
Label1.Caption = Soru(scount)
Option1.Caption = a(scount)
Option2.Caption = b(scount)
Option3.Caption = c(scount)
Option4.Caption = d(scount)
ElseIf scount = 3 Then
Label3.Caption = dogru * 25
Command1.Enabled = False
End If
End Sub
bu KODLARI ekledikten sonraa F5 e basıp projemizi çalıştıralımm..


