private void SetLogItemtext(ListViewItem item, string text) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (ConvertLogLV.InvokeRequired) { SetLogItemtextCallback d = new SetLogItemtextCallback(SetLogItemtext); ConvertLogLV.BeginInvoke(d, new object[] { item, text }); } else { item.Text = text; ConvertLogLV.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); } }