Thread: RichTextBox

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

    RichTextBox

    I am trying to do this:
    I have created a WindowsForm Application and to this put a "RichTextBox" and a "Button".


    I dont really know what approch that could be used for this purpose.
    Assume that we have this code:

    Code:
    int Number1 = 0;
    int Number2 = 10;
    int Number3 = 0;
    
    if (Number1 < Number2)
    	{
    		Number3 = 10;
    	}
    This is working fine, we assign Number3 = 10; here.
    Now what I want to do is to interact with this code through this RichTextBox and what I want to write in this box is the statement:
    Code:
    if (Number1 < Number2)
    So instead of writing this in the code, I will write this line in the RichTextBox instead.
    How is this possible to do ? Where do I begin ?

    Thanks
    Last edited by Coding; 02-02-2008 at 07:43 PM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Don't use C++ .NET. If you want to use Windows Form Applications, get C#. Otherwise follow the advice in the other thread.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    okay I have Visual C# 2008 Express Edition too. I will give it a shot and try to do it here then and see if it could work ?

    So this will work using Windows Form Applications in C#.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    I have created a "richTextBox1" and my buttoncode in C# look like this:

    Code:
    private void button1_Click(object sender, EventArgs e)
    {
       
    int Number1 = 0;
    int Number2 = 10;
    int Number3 = 0;
    
    if (Number1 < Number2)        // This line I want to put in "richTextBox1" instead.
    	{
    		Number3 = 10;
    	}
    
    }
    Last edited by Coding; 02-02-2008 at 08:27 PM.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Coding View Post
    okay I have Visual C# 2008 Express Edition too. I will give it a shot and try to do it here then and see if it could work ?

    So this will work using Windows Form Applications in C#.
    Yes! C# is standard so it should work.
    I'm not experienced or familiar with C#, however, but I'm sure someone else can help you.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    Okay... That sounds good. It would be nice to know what approach that could be taken doing this.
    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Disable RichTextBox mouse wheel
    By theoobe in forum C# Programming
    Replies: 2
    Last Post: 05-08-2009, 11:27 AM
  2. Change RichTextBox Color
    By C_ntua in forum C# Programming
    Replies: 8
    Last Post: 12-18-2008, 03:44 PM
  3. Multilined RichTextBox
    By Coding in forum Windows Programming
    Replies: 3
    Last Post: 03-21-2008, 08:10 AM
  4. RichTextBox and syntax highlighting
    By Rune Hunter in forum C# Programming
    Replies: 0
    Last Post: 06-12-2007, 02:16 PM
  5. searching text in richtextbox
    By SuperNewbie in forum C# Programming
    Replies: 4
    Last Post: 08-02-2002, 09:44 AM