[C#] noobish problem

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

[C#] noobish problem

Post 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?
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

You can pass the text back from the pop-up to the main window with a return afaik.
Image
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post 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..
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post 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...
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Ok! good idea :)

now it seems so simple..

Thanx Ben! :)
Post Reply