How can I use values from the timer_lights_status_Tick method in groupBox1_Paint?
public Main()
{
InitializeComponent();
}
private void groupBox1_Paint(object sender, PaintEventArgs e)
{
// Here is where I want to use those variables: red_light1, yellow_light1…
}
public void timer_lights_status_Tick(object sender, EventArgs e)
{
int red_light1, yellow_light1, green_light1,
red_light2, yellow_light2, green_light2;
red_light1 = Convert.ToInt32(comport.message(4, 8, 32));
yellow_light1 = Convert.ToInt32(comport.message(4, 8, 33));
green_light1 = Convert.ToInt32(comport.message(4, 8, 34));
red_light2 = Convert.ToInt32(comport.message(4, 8, 35));
yellow_light2 = Convert.ToInt32(comport.message(4, 8, 36));
green_light2 = Convert.ToInt32(comport.message(4, 8, 37));
}