Problem
Hi everyone, I am developing a piano in C#. I have succeeded in creating the piano and it plays fine. However, I want to make use of two timers:
One timer to keep check of how much time the left mouse button was kept down (in Form.cs) and another timer to play the music according to how much time the left mouse button was kept down (this timer is found in MusicNote.cs).
The first timer works as it should and it increases the duration with every tick. The problem is that when I try to pass the global variable duration from Form1 to MusicNote.PlayMusic, the duration value becomes 0 and not the value which was displayed correctly in textBox2.Text.
The same problem occurs when trying to pass bNoteShape from Form1 to MusicNote.
Edit
Thank you all. I have solved the problem.