标签:delegate eve tag 使用 end element state 解决 tostring
private void textBox2_TextChanged(object sender, EventArgs e)
{
int count = dataGridView1.Rows.GetRowCount(DataGridViewElementStates.Visible);
label2.Text = "on";
Thread objThread = new Thread(new ThreadStart(delegate
{
string Temp = textBox2.Text.Trim();
for (int i = 0; i < count - 1; i++)
{
if (!dataGridView1.Rows[i].Cells[0].Value.ToString().ToUpper().Contains(Temp))
{
dataGridView1.Rows[i].Visible = false;
}
}
}));
objThread.Start();
}
添加以下代码,忽略控件多线程的安全机制:
Control.CheckForIllegalCrossThreadCalls = false;
标签:delegate eve tag 使用 end element state 解决 tostring
原文地址:https://www.cnblogs.com/jizhiqiliao/p/9870744.html