private void button1_Click(object sender, EventArgs e) { p = new Point[txt.GetUpperBound(0) + 1]; book = new bool[p.Length]; for (int i = 1; i < p.Length; i++) { p[i] = new Point(int.Parse(txt[i, 0].Text), int.Parse(txt[i, 1].Text)); book[i] = false; } min = 2147483647; for (int i = 1; i < p.Length; i++) { record.Clear(); book[i] = true; record.Add(i); dfs(1, p[i], 0); book[i] = false; } label5.Text = min.ToString(); }
/// <summary> /// Crée les textbox dynamiquement sur la form /// </summary> private void InitialiserTextBox() { variableSimplex = new TextBox[nombreValeur + 1, nombreEquation + 1]; int x = 10; int y = 10; for (int j = variableSimplex.GetLowerBound(1); j <= variableSimplex.GetUpperBound(1); j++) { for (int i = variableSimplex.GetLowerBound(0); i <= variableSimplex.GetUpperBound(0); i++) { variableSimplex[i, j] = new TextBox(); variableSimplex[i, j].Location = new Point(x, y); variableSimplex[i, j].Size = new Size(46, 20); this.Controls.Add(variableSimplex[i, j]); x += 60; } x = 10; y += 30; } buttonCalculer.Location = new Point(x, y); if (this.Size.Height <= y || this.Size.Width <= x) { this.Size = new Size(1000,1000); } }