Page 1 of 1

[C#] noobish problem

Posted: Mon 11 Jun, 2007 6:39 am
by King Harold
I have a little problem, kinda noobish really.
I want a tool window to change the text in a richTextBox of the main window, but the Text attribute of the richTextBox is exactly that, thus it cannot be REF-ed. Now what do I do? If I pass the text as creation parameter to the toolwindow then I can edit it all I want - but then how do I let the main window know that it is to change it's own text into that?

Posted: Mon 11 Jun, 2007 9:28 am
by kv83
You can pass the text back from the pop-up to the main window with a return afaik.

Posted: Mon 11 Jun, 2007 10:14 am
by King Harold
Well, it doesn't return anywhere.. It closes.. Like a form..
atleast, as far as I know, that is..
all those annoying async things confuse me mightily..

Posted: Mon 11 Jun, 2007 11:54 am
by benryves
Why not simply pass the RichTextBox object in the constructor of the child form? As a RichTextBox is a class it'll be passed by reference...

Posted: Mon 11 Jun, 2007 12:45 pm
by King Harold
Ok! good idea :)

now it seems so simple..

Thanx Ben! :)