Tutorial 4 in ODN correction

pepote

16-04-2006 23:55:22

To turn off or on the ligth with left mouse button don't run.

But If you put the case 16 into MouseRelease this work Ok!!!

I wrote output to console with MousePressed option to turn on or off and I obtain two consecutives changues allways I click left button:

the code
light.SetVisible(!light.IsVisible());
Console.WriteLine("Light state is"+light.IsVisible().toString();

the console output
Light state is false
Light state is true

pepote

17-04-2006 00:00:41

Was my foult reading the Tutorial.

I already put EvenHandler for MousePressed at firts. But when in tutorial show joined all Mouse events I copy and paste in code, and then I duplicate the EventHanler.

Sorry

:oops: