Thread: 3 RichTextBoxes

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    385

    3 RichTextBoxes

    I have created 3 RichTextBoxes, a label and a Button.

    As the code goes, if I write a number in RichTextBox 2 and another in RichTextBox3 and press the Button.
    These will be added and show a result in the label. (Ex: 5 + 3 = 8)

    Now I wonder for a function here. I will add another "RichTextBox1" that will make a statement like:

    if 3 = 3 (wich is true ofcourse)

    then the calculation for in the example (5 + 3) will execute otherwise not !

    How could this be possible. Is it possible to use a bool for RichTextBox1 in any way here and if what is written in RichTextBox3 is True like:
    3 = 3 then it continues with the code below to Add (5 + 3) ?
    This code is working for RichTextBox2 and 3 as a calculator:
    Code:
    double FirstValue = double.Parse(richTextBox2.Text);
    double SecondValue = double.Parse(richTextBox3.Text);
    
    double result = 0;
    
    result = FirstValue + SecondValue;
    
    label1.Text = result.ToString();
    Last edited by Coding; 02-02-2008 at 04:46 PM.

Popular pages Recent additions subscribe to a feed