private void toolStripButton2_Click(object sender, EventArgs e) { if (!th.IsAlive) { graf = new prikaz_tocki(p); th = new Thread(graf.poc); th.Start(); } }
public void poc() { Thread.CurrentThread.Priority = ThreadPriority.Highest; Thread.Sleep(1000); using (prikaz_tocki kordinatni = new prikaz_tocki(PostavkeGrafike)) { // Get the title and category of this example using reflection. kordinatni.Title = "Prikaz Funkcija"; kordinatni.Icon = global::Interpolator.Properties.Resources.MainIcon; kordinatni.Run(1.0, 120.0); } }
public Form1() { CheckForIllegalCrossThreadCalls = false; p = new Postavke(); p.Show(); p.Hide(); graf = new prikaz_tocki(p); th = new Thread(graf.poc); //var obj = new WindowsFormsApplication1.SimpleWindow(); //new Thread(obj.poc).Start(); InitializeComponent(); number_of_controls_without_funcs = this.Controls.Count; dbpath = Application.StartupPath + global::Interpolator.Properties.Resources.NameOfDbString; if (!File.Exists(dbpath)) { ADOX.Catalog cat = new ADOX.Catalog(); try { cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dbpath); } catch (Exception e) { if (Debug) { MessageBox.Show(e.ToString()); } } cat = null; } else { ADOX.Catalog cat = new ADOX.Catalog(); System.IO.File.Delete(dbpath); cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dbpath); } conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dbpath); //adapter.Fill(medataset); try { using (OleDbCommand cmd = new OleDbCommand(global::Interpolator.Properties.Resources.PropertiesCreateString, conn)) { conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } } catch (Exception ee) { if (Debug) { MessageBox.Show("Error: " + ee.ToString()); } } medataset = new DataSet(); OleDbCommand cmd1 = new OleDbCommand(selekt, conn); adapter = new OleDbDataAdapter(cmd1); adapter.Fill(medataset); updatezy(); }