3 RichTextBoxes

This is a discussion on 3 RichTextBoxes within the Windows Programming forums, part of the Platform Specific Boards category; I have created 3 RichTextBoxes, a label and a Button. As the code goes, if I write a number in ...

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

    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 03:46 PM.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21