🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.winforms.general
2 messages
2 total messages Started by gara Tue, 03 Aug 2004 06:41
is it possible to get values in mainform?
#28
Author: gara
Date: Tue, 03 Aug 2004 06:41
17 lines
1410 bytes
Hi could you help me ?

I need to read values from mainform when i am in second form
(form2). i can read values from main form but i have to create 
mainform second time. if i create mainform second time then i 
can not get the values which where entered after creation. So i 
need to get reference to existing mainform. Could you show me i
 can i get the reference to existing mainform. 

ex : 
1-mainForm is open application is running 
2-entering some text to textbox1 
3-Button click opening second form(form2).
4-On second form(form2) Button click to get value in textbox1 on mainform.

how can i do it , could you help me !
Re: is it possible to get values in mainform?
#29
Author: Marc Rohloff TeamB
Date: Tue, 03 Aug 2004 11:48
18 lines
1476 bytes
On 2 Aug 2004 23:41:55 -0700, gara wrote:

> I need to read values from mainform when i am in second form
> (form2). 

> how can i do it , could you help me !

After the main form has created your second form it should either pass
the values the second form needs or a reference to the second form.

There are a couple of ways of doing this:
- Add them to the seoncd form's constructor (my recommendation)
- Create properties on the second form which can be set
- Create a function on the second form to take the parameters

-- 
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads