private void CbCvetaLoad() { Action action = () => { try { DataBaseTables tables = new DataBaseTables(); tables.dtCvet_TovFill(); tables.dependency.OnChange += CbCvetaonchange; comboBox2.DataSource = tables.dtCvet_Tov; comboBox2.ValueMember = "ID_Cvet"; comboBox2.DisplayMember = "Cvet"; } catch { } }; Invoke(action); }
private void CvetaLoad() { Action action = () => { try { DataBaseTables tables = new DataBaseTables(); tables.dtCvet_TovFill(); tables.dependency.OnChange += Cvetaonchange; listBox2.DataSource = tables.dtCvet_Tov; listBox2.ValueMember = "ID_Cvet"; listBox2.DisplayMember = "Cvet"; Thread threadCvet = new Thread(CbCvetaLoad); threadCvet.Start(); } catch { } }; Invoke(action); }