2 Replies - 217 Views - Last Post: 07 December 2011 - 02:42 PM Rate Topic: -----

#1 Vally7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 29-January 10

Timer Problem

Posted 07 December 2011 - 01:41 PM

Hi!I have a problem with a timer.
My first timer has this code :
Dim n As Integer = label3.Text
		if n>10 then
			Dim Randomly As New Random
		Dim I As Integer
		I = Randomly.Next(1,52)
		Label1.Text = I
		If I = 1 Then
			 If Picturebox14.Visible = True  Then
			Label2.Text = "The Flag Of Croatia Is:"
			Timer1.Stop()
			 Else
			 	Timer1.Start()
			End If
			End If

It has this code for every I from 1 to 51 with the correspondant picturebox and text.After I = 51 here is the code:
 Else
					timer3.Start
					timer1.stop
					End If

Every picturebox has this code with correspondent number:
If Label1.Text = "1" Then
			Picturebox14.Visible = False
		Timer1.Start
		Label5.Text = Label5.Text + 1
		Label3.Text = Label3.Text - 1
		Else
			Label7.Text = Label7.Text + 1
			End If

Timer 3 has this code for every picturebox:
 Timer3Tick(sender As Object, e As EventArgs)
		timer1.Stop()
		if label5.Text<51 then
			if richtextbox1.Text="" then
			If picturebox1.Visible = True Then
				richtextbox1.AppendText("iceland")
			End If

Then this for every picturebox:
 else
			if richtextbox1.text.startswith("poland") = true then
				label2.Text="The Flag Of Poland Is:"
				RichTextBox1.Text = richtextbox1.text.Replace("poland","")
				Label1.Text = "46"
				timer3.stop
				end if

Then this:
Else
		label2.Text="Congratulations!You have done it!Click the button to save your score."
		button1.Visible=True
		timer2.stop
		End If
		timer3.stop

The problem is that the first time timer 3 is in use it changes the text of label2 2-3 times/per second and you need to click the flag quickly.Then it behaves normally waiting for the click.What is the problem,in your opinion?

This post has been edited by Vally7: 07 December 2011 - 01:42 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Timer Problem

#2 dbasnett  Icon User is offline

  • D.I.C Addict

Reputation: 102
  • View blog
  • Posts: 584
  • Joined: 01-October 08

Re: Timer Problem

Posted 07 December 2011 - 02:06 PM

Without code can you explain what you are trying to do?
Was This Post Helpful? 0
  • +
  • -

#3 Vally7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 29-January 10

Re: Timer Problem

Posted 07 December 2011 - 02:42 PM

Yes.
First of all if the remaining pictures are more than 10 the first timer chooses which picturebox you need to click.If you click the correct picture it starts again choosing another.When the remaining pictures reaches 10 timer3 should start writing the name of the countries in a richtextbox.Then,sees which is the first one,writes the text and removes the country from the richtextbox.The problem is that when the remaining number is 10 timer 3 loops and doesn't wait until the picturebox is clicked.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1