private void DisplayTableName() { // 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 (this.lblTableName.InvokeRequired) { //call itself on the main thread DisplayTableNameCallback d = new DisplayTableNameCallback(DisplayTableName); this.Invoke(d); } else { this.lblTableName.Text = m_current_table_name; } }