Then do so. If you have specific problems understanding someting in one of the turorials, plase post the URL you got the tutorial from and your question.Quote:
Originally Posted by johnboy14
Until then....
Printable View
Then do so. If you have specific problems understanding someting in one of the turorials, plase post the URL you got the tutorial from and your question.Quote:
Originally Posted by johnboy14
Until then....
http://msdn.microsoft.com/en-us/library/3tszykws.aspx
I'm using this tutorial, not I can't figure out what to put in my timer event.
I want to press button1
wait 5 seconds
and the world "ON" should be placed in the text box of my choice
wait another 5
and the word "ON" is allocated as sequence of traffic lights.
Press button. In click even enable the timer. In the timer_tick method look to see if the light is on, if so turn it off, else turn it in.
Thats it
[QUOTE=In the timer_tick method look to see if the light is on, if so turn it off, else turn it in.
Thats it[/QUOTE]
I don't know what your talking about here mate.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void InitializeTimer()
{
//' Run this procedure in an appropriate event.
// Set to 5 second.
timer1.Interval = 5000;
// Enable timer.
timer1.Enabled = true;
StartButton.Text = "Stop";
}
private void timer1_Tick(object sender, EventArgs e)
{
}
private void StartButton_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
red.Text = ("OFF");
amber.Text = ("ON");
green.Text = ("OFF");
}
}
}
1) Please use [ code ] tags. and use preview, so you dont have messed up posts.
There are more efficient way using enums, and arrays, but this will work (sucject to typos, but you should get the ides....Code:private void timer1_Tick(object sender, EventArgs e)
{
if (red.Text == "ON")
{
red.Text=="OFF"
green.Text = "ON"
}
else if (green.Text == "ON")
{
green.Text = "OFF";
amber.Text = "ON";
}
else
{
amber.Text = "OFF";
red.Text = "ON";
}
}
that makes perfect sense, using bool expressions. Thanks again, I don't mean to be a dump *** but its all part of my learning methods. http://www.codeguru.com/forum/images/icons/icon10.gif