P
PiotrKolodziej
Hi.
Iam trying to make it work:
My application receives data from RS port by the DataReceived event. Then
this event is accesing dataGridview, but when i have some errors connected
with accesing this datagrid. Sometimes it works properly, sometimes not.
For any help thanks
Here is sample code:
void rs_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
try
{
string t = rs.ReadLine(); t = t.Remove(t.Length - 1);
string temp = configFile.getParameter("b" + t);
if (temp == null)
{
if (MessageBox.Show("Button is not recognized. Would you
like to add function to this button?", "New Button detected",
MessageBoxButtons.YesNo,
MessageBoxIcon.Information) == DialogResult.Yes)
{
Form2 form2 = new Form2();
form2.Button = "b" + t;
if (form2.ShowDialog() != DialogResult.Cancel)
{
//System.Threading.Thread.Sleep(500);
Fill_DataGrid();
}
}
.........
}
Iam trying to make it work:
My application receives data from RS port by the DataReceived event. Then
this event is accesing dataGridview, but when i have some errors connected
with accesing this datagrid. Sometimes it works properly, sometimes not.
For any help thanks
Here is sample code:
void rs_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
try
{
string t = rs.ReadLine(); t = t.Remove(t.Length - 1);
string temp = configFile.getParameter("b" + t);
if (temp == null)
{
if (MessageBox.Show("Button is not recognized. Would you
like to add function to this button?", "New Button detected",
MessageBoxButtons.YesNo,
MessageBoxIcon.Information) == DialogResult.Yes)
{
Form2 form2 = new Form2();
form2.Button = "b" + t;
if (form2.ShowDialog() != DialogResult.Cancel)
{
//System.Threading.Thread.Sleep(500);
Fill_DataGrid();
}
}
.........
}