Error :'Proj.frmMain' does not contain a definition for 'Comm1
-
hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1 namespace Proj { public partial class frmMain : Form { private string[] tx_data = new string[14]; private string[] rx_data = new string[10]; public int i; public frmMain() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void label16_Click(object sender, EventArgs e) { } private void label18_Click(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void txtTxmID1_TextChanged(object sender, EventArgs e) { } private void txtTxmID5_TextChanged(object sender, EventArgs e) { } private void lblRx2_TextChanged(object sender, EventArgs e) { } private void lblRx5_TextChanged(object sender, EventArgs e) { } private void cmdRead_Click(object sender, EventArgs e) { readID; //For i = 1 To 6 // lblRx(i).Caption = rx_data(i + 1) //Next i string OutString = null; string Instring = null; int y = 0; open_port; //If the port is opened... if (Comm1.PortOpen) { //tx_data(0) = "R" //tx_data(1) = "I" //tx_data(2) = "D" //For i = 0 To 2 // Comm1.Output = tx_data(i) //Next i OutString = "RID"; Comm1.Output = OutString; } } private void Comm1_OnComm() { string Instring = null; for (i = 0; i <= 7; i++) { Instring = Comm1.Input; if (Instring == "") { rx_data[i] = "00"; } else { rx_data[i] = System.Conv
-
hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1 namespace Proj { public partial class frmMain : Form { private string[] tx_data = new string[14]; private string[] rx_data = new string[10]; public int i; public frmMain() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void label16_Click(object sender, EventArgs e) { } private void label18_Click(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void txtTxmID1_TextChanged(object sender, EventArgs e) { } private void txtTxmID5_TextChanged(object sender, EventArgs e) { } private void lblRx2_TextChanged(object sender, EventArgs e) { } private void lblRx5_TextChanged(object sender, EventArgs e) { } private void cmdRead_Click(object sender, EventArgs e) { readID; //For i = 1 To 6 // lblRx(i).Caption = rx_data(i + 1) //Next i string OutString = null; string Instring = null; int y = 0; open_port; //If the port is opened... if (Comm1.PortOpen) { //tx_data(0) = "R" //tx_data(1) = "I" //tx_data(2) = "D" //For i = 0 To 2 // Comm1.Output = tx_data(i) //Next i OutString = "RID"; Comm1.Output = OutString; } } private void Comm1_OnComm() { string Instring = null; for (i = 0; i <= 7; i++) { Instring = Comm1.Input; if (Instring == "") { rx_data[i] = "00"; } else { rx_data[i] = System.Conv
-
Inside frmMain, from the look of it.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1 namespace Proj { public partial class frmMain : Form { private string[] tx_data = new string[14]; private string[] rx_data = new string[10]; public int i; public frmMain() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void label16_Click(object sender, EventArgs e) { } private void label18_Click(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void txtTxmID1_TextChanged(object sender, EventArgs e) { } private void txtTxmID5_TextChanged(object sender, EventArgs e) { } private void lblRx2_TextChanged(object sender, EventArgs e) { } private void lblRx5_TextChanged(object sender, EventArgs e) { } private void cmdRead_Click(object sender, EventArgs e) { readID; //For i = 1 To 6 // lblRx(i).Caption = rx_data(i + 1) //Next i string OutString = null; string Instring = null; int y = 0; open_port; //If the port is opened... if (Comm1.PortOpen) { //tx_data(0) = "R" //tx_data(1) = "I" //tx_data(2) = "D" //For i = 0 To 2 // Comm1.Output = tx_data(i) //Next i OutString = "RID"; Comm1.Output = OutString; } } private void Comm1_OnComm() { string Instring = null; for (i = 0; i <= 7; i++) { Instring = Comm1.Input; if (Instring == "") { rx_data[i] = "00"; } else { rx_data[i] = System.Conv
Some serious advice. This is the code of a person who needs to buy a beginner book, and work through it, before thinking about any sort of winforms programming.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
This is simple. You have not defined the Comm1. May be, during start you have defined and later you have commented/deleted it. Otherwise, jut re-define the Comm1.
Sr. Software Engineer Irevna, India