Click here to Skip to main content
16,005,682 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: msdn.mircrosoft....? Pin
Christian Graus22-Nov-06 10:06
protectorChristian Graus22-Nov-06 10:06 
QuestionLogon to website code? Pin
cstrader23222-Nov-06 7:38
cstrader23222-Nov-06 7:38 
AnswerRe: Logon to website code? Pin
jsampsonPC22-Nov-06 7:40
jsampsonPC22-Nov-06 7:40 
GeneralRe: Logon to website code? Pin
cstrader23222-Nov-06 8:03
cstrader23222-Nov-06 8:03 
AnswerRe: Logon to website code? Pin
Christian Graus22-Nov-06 9:09
protectorChristian Graus22-Nov-06 9:09 
GeneralRe: Logon to website code? Pin
cstrader23222-Nov-06 9:53
cstrader23222-Nov-06 9:53 
GeneralRe: Logon to website code? Pin
Christian Graus22-Nov-06 10:04
protectorChristian Graus22-Nov-06 10:04 
Questionrandomize answers in quiz Pin
bapu288922-Nov-06 7:11
bapu288922-Nov-06 7:11 
hello
here i am posting my code for quiz application and i want to randomize 4 answers 3 wrong and 1 correct answers i manage to randomize correct answer but other three answers are not but it shows three wrong answers but it's from other question

Dim Question(14), Ans1(14), WrongAns(14, 3), Clue(14), CorrectAns(14) As String
Dim TotalQuestion2 As Integer
Dim Score2 As Integer
Dim startTime As DateTime
Dim Time As Date
Dim N As Integer
Dim Asked(14) As Boolean

Private Sub mnuFileTyAns_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFileTyAns.Click
Dim MyForm As New frmSQuiz
MyForm.Show()
MyForm.ActiveForm.Text = "Well Come " & Address & " to Type - In - Answer Section ...."
Me.Close()
End Sub
Private Sub mnuHelpAbout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuHelpAbout.Click
Dim MyForm As New frmAbout
MyForm.Show()
MyForm.txtAbout.Visible = True
MyForm.ActiveForm.Text = "About Quiz ......"
End Sub
Private Sub mnuFileExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFileExit.Click
Me.Close()
End Sub
Private Sub frmMultiple_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
Time = Now
'get questions and answers arrays
Question(0) = "Macadamia and almonnd are types of what ?" : Ans1(0) = "Nuts" : WrongAns(0, 0) = "Fruit" : WrongAns(0, 1) = "Tree" : WrongAns(0, 2) = "Vagetable" : WrongAns(0, 3) = "Powder" : Clue(0) = "Do you know about any magazine ?" : CorrectAns(0) = "Nuts"
Question(1) = "In astrology the star sign Piseces is represented by which animal ?" : Ans1(1) = "Fish" : WrongAns(1, 0) = "Donkey" : WrongAns(1, 1) = "Lion" : WrongAns(1, 2) = "Snake" : WrongAns(1, 3) = "Lynx" : Clue(1) = "It,s very testy" : CorrectAns(1) = "Fish"
Question(2) = "Where is Tower bridge ?" : Ans1(2) = "London" : WrongAns(2, 0) = "Dubai" : WrongAns(2, 1) = "USA" : WrongAns(2, 2) = "India" : WrongAns(2, 3) = "Pakistan" : Clue(2) = "Sterling" : CorrectAns(2) = "London"
Question(3) = "Where is liberty statue ?" : Ans1(3) = "USA" : WrongAns(3, 0) = "London" : WrongAns(3, 1) = "Dubai" : WrongAns(3, 2) = "India" : WrongAns(3, 3) = "Pakistan" : Clue(3) = "NY" : CorrectAns(3) = "USA"
Question(4) = "In geography where is Mount Fuji ?" : Ans1(4) = "Japan" : WrongAns(4, 0) = "Taiwan" : WrongAns(4, 1) = "China" : WrongAns(4, 2) = "USA" : WrongAns(4, 3) = "Pakistan" : Clue(4) = "It's very small country " : CorrectAns(4) = "Japan"
Question(5) = "What 'L' is an engine for hauling railway trains ?" : Ans1(5) = "Locomotive" : WrongAns(5, 0) = "Load" : WrongAns(5, 1) = "Loose" : WrongAns(5, 2) = "Non of these" : WrongAns(5, 3) = "Late" : Clue(5) = "What's your motive ?" : CorrectAns(5) = "Locomotive"
Question(6) = "If a scooter travels at 20 miles/H,how many miles will it travel in half an hour ?" : Ans1(6) = "10-miles" : WrongAns(6, 0) = "12-miles" : WrongAns(6, 1) = "20-miles" : WrongAns(6, 2) = "5-miles" : WrongAns(6, 3) = "20.5-miles" : Clue(6) = "Some thing devided by 2" : CorrectAns(6) = "10-miles"
Question(7) = "Which london park has an open-air theatre and a zoo ?" : Ans1(7) = "Regent's Park" : WrongAns(7, 0) = "King Park" : WrongAns(7, 1) = "Queen Park" : WrongAns(7, 2) = "Safari Park" : WrongAns(7, 3) = "Zoo Park" : Clue(7) = "'Enter - G' make one word" : CorrectAns(7) = "Regent's Park"
Question(8) = "In science is neon a solid, liquid or gas under normal conditions ?" : Ans1(8) = "Gas" : WrongAns(8, 0) = "Liquid" : WrongAns(8, 1) = "Solid" : WrongAns(8, 2) = "Non of These" : WrongAns(8, 3) = "Powder" : Clue(8) = "We use it every day" : CorrectAns(8) = "Gas"
Question(9) = "On which side of the road do cars drive in Australia ?" : Ans1(9) = "Left" : WrongAns(9, 0) = "Right" : WrongAns(9, 1) = "In-Middle" : WrongAns(9, 2) = "Both" : WrongAns(9, 3) = "Non" : Clue(9) = "What do you think in UK?" : CorrectAns(9) = "Left"
Question(10) = "In sport kung fu is which countries martial art ?" : Ans1(10) = "Chinese" : WrongAns(10, 0) = "Japanese" : WrongAns(10, 1) = "Indian" : WrongAns(10, 2) = "Korian" : WrongAns(10, 3) = "Pakistani" : Clue(10) = "Population is big issue" : CorrectAns(10) = "Chinese"
Question(11) = "In which country would you find the industrial port of Le Harve ?" : Ans1(11) = "France" : WrongAns(11, 0) = "USA" : WrongAns(11, 1) = "China" : WrongAns(11, 2) = "Japan" : WrongAns(11, 3) = "Rusia" : Clue(11) = "Do you remember any Tower...?" : CorrectAns(11) = "France"
Question(12) = "How many wheels does a unicycle have ?" : Ans1(12) = "One" : WrongAns(12, 0) = "Two" : WrongAns(12, 1) = "Three" : WrongAns(12, 2) = "Four" : WrongAns(12, 3) = "Non" : Clue(12) = "It's hard to drive" : CorrectAns(12) = "One"
Question(13) = "In food which fruit is dried to make a prune ?" : Ans1(13) = "Plum" : WrongAns(13, 0) = "Mengo" : WrongAns(13, 1) = "Banana" : WrongAns(13, 2) = "Orange" : WrongAns(13, 3) = "Apple" : Clue(13) = "It's round,sweet and some time it's sour" : CorrectAns(13) = "Plum"
Question(14) = "In which sport are the Ashes a trophy ?" : Ans1(14) = "Cricket" : WrongAns(14, 0) = "Foot Ball" : WrongAns(14, 1) = "Snooker" : WrongAns(14, 2) = "Rugby" : WrongAns(14, 3) = "Hockey" : Clue(14) = "Some time player stand at silly point" : CorrectAns(14) = "Cricket"
Call GetNextQuestion()
lbltime.Text = Format(Time, "dd MMM yyyy")
startTime = DateTime.Now()
Timer1.Start()
End Sub
Private Sub GetNextQuestion()
Dim LB() As Label = {lblA, lblB, lblC, lblD}
Dim J As Integer
Do
N = CInt(Rnd() * 14)
Loop Until Asked(N) = False
Asked(N) = True
lblQuestion.Text = Question(N)
Dim ansWX As String = WrongAns(N, J)
Dim ansWR As String = CorrectAns(N)
'randomize 3 wrong answers
For J = 0 To 3
Do
ansWX = WrongAns(CInt(Rnd() * 14), 3)
Loop Until ansWX <> ansWR And ansWX <> LB(0).Text And ansWX <> LB(1).Text And ansWX <> LB(2).Text
LB(J).Text = ansWX
Next J
'randomize one correct answer
LB(CInt(Rnd() * 3)).Text = ansWR
lblA.BackColor = Color.Beige
lblB.BackColor = Color.Beige
lblC.BackColor = Color.Beige
lblD.BackColor = Color.Beige
End Sub


wating for rep. Frown | :(

thank you
AnswerRe: randomize answers in quiz Pin
Guffa22-Nov-06 7:28
Guffa22-Nov-06 7:28 
GeneralRe: randomize answers in quiz Pin
Christian Graus22-Nov-06 7:35
protectorChristian Graus22-Nov-06 7:35 
GeneralRe: randomize answers in quiz Pin
Paul Conrad22-Nov-06 8:52
professionalPaul Conrad22-Nov-06 8:52 
GeneralRe: randomize answers in quiz Pin
Christian Graus22-Nov-06 9:03
protectorChristian Graus22-Nov-06 9:03 
GeneralRe: randomize answers in quiz Pin
Paul Conrad22-Nov-06 12:12
professionalPaul Conrad22-Nov-06 12:12 
AnswerRe: randomize answers in quiz Pin
Christian Graus22-Nov-06 7:34
protectorChristian Graus22-Nov-06 7:34 
QuestionChanging background color of datagrid cells in vb.net Pin
Silver-Grey22-Nov-06 6:37
Silver-Grey22-Nov-06 6:37 
AnswerRe: Changing background color of datagrid cells in vb.net Pin
jsampsonPC22-Nov-06 6:55
jsampsonPC22-Nov-06 6:55 
GeneralRe: Changing background color of datagrid cells in vb.net Pin
Silver-Grey22-Nov-06 7:21
Silver-Grey22-Nov-06 7:21 
GeneralRe: Changing background color of datagrid cells in vb.net Pin
jsampsonPC22-Nov-06 7:29
jsampsonPC22-Nov-06 7:29 
GeneralRe: Changing background color of datagrid cells in vb.net Pin
Silver-Grey22-Nov-06 8:33
Silver-Grey22-Nov-06 8:33 
GeneralRe: Changing background color of datagrid cells in vb.net Pin
jsampsonPC22-Nov-06 9:20
jsampsonPC22-Nov-06 9:20 
Questionhidden database Pin
licec22-Nov-06 4:48
licec22-Nov-06 4:48 
AnswerRe: hidden database Pin
Dave Kreskowiak22-Nov-06 5:09
mveDave Kreskowiak22-Nov-06 5:09 
Questionsend a picture to msword Pin
licec22-Nov-06 4:40
licec22-Nov-06 4:40 
AnswerRe: send a picture to msword Pin
b43r_3oo322-Nov-06 20:41
b43r_3oo322-Nov-06 20:41 
Questionvb6 typeof question Pin
Russell Jones22-Nov-06 4:31
Russell Jones22-Nov-06 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.