It's pretty simple: you have
using
statements which reference both namespaces:
using System.Windows.Forms;
...
using System.Timers;
So when you type the name of a class (in this case
Timer
) the compiler can't be certain which Timer you mean:
System.Windows.Forms.Timer[
^] or
System.Timers.Timer[
^]
So you have to either remove the unnecessary
using
statement; or fully qualify the namespace of the class you wanted:
public System.Windows.Forms.Timer tmrComm = new System.Windows.Forms.Timer();
Or
public System.Timers.Timer tmrComm = new System.Timers.Timer();