Пример #1
0
        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            TxtX1.Clear();
            TxtX2.Clear();
            CBSign.Items.Clear();
            TxtRHS.Clear();
            //listBox3.Items.Clear();

            foreach (Constraint item in constraints)
            {
                string sign;
                if (item.Sign.Equals("Less"))
                {
                    sign = "<=";
                }
                else if (item.Sign.Equals("Greater"))
                {
                    sign = ">=";
                }
                else
                {
                    sign = "=";
                }
                string temp = item.XOneCoeff + "X1 + " + item.XTwoCoeff + "X2 " + sign + " " + item.RHS;
                if (temp.Equals(LBDisplay.SelectedItem))
                {
                    TxtX1.Text = item.XOneCoeff.ToString();
                    TxtX2.Text = item.XTwoCoeff.ToString();
                    CBSign.Items.Add(item.Sign);
                    TxtRHS.Text = item.RHS.ToString();
                }
            }
        }
Пример #2
0
 private void BtnLimpiar_Click(object sender, RoutedEventArgs e)
 {
     TxtX0.Clear();
     TxtX1.Clear();
     DgIteraciones.ItemsSource = null;
     TxtX0.Focus();
 }