Ejemplo n.º 1
0
        private void Calculate_Click(object sender, RoutedEventArgs e)
        {
            int a, b;
            float fA, fB;

            a = int.Parse(textBoxA.Text);
            b = int.Parse(textBoxB.Text);
            fA = float.Parse(textBoxfA.Text);
            fB = float.Parse(textBoxfB.Text);

            try
            {
                ClassLibrary1.Class1 externalDLL = new ClassLibrary1.Class1();
                Substract.Sub substractDLL = new Substract.Sub();

                textBoxCalc.Text = externalDLL.sum(a, b).ToString();
                textBoxCalcSubstract.Text = substractDLL.substract(fA, fB).ToString();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }