Results 1 to 3 of 3

Thread: Editing a RichTextBox from another class. [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member deranged's Avatar
    Join Date
    Jun 2004
    Location
    TN
    Posts
    104

    Editing a RichTextBox from another class. [RESOLVED]

    So far, I have a richTextBox made with Visual Studio (Named richTextBox1). I have a separate class that needs to change the text in the box. The textbox is in class Form1.

    So far, what I have is :

    In class Form1
    Code:
    		public void txtchange(string changeinfo)
    		{
    			richTextBox1.Text += "\n" + changeinfo;
    		}
    and in the other class, I have
    Code:
    Form1.txtchange("blah blah");


    The error it gives me on build is:

    Form1.cs(214): An object reference is required for the nonstatic field, method, or property 'GUIbot.Form1.txtchange(string)'
    Last edited by deranged; Jul 5th, 2005 at 02:22 AM. Reason: resolution found.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width