Re: NEWBIE - Accessing Variables stored in another form

From: Dave (nospam_at_yahoo.com)
Date: 01/18/05


Date: Tue, 18 Jan 2005 16:58:28 -0500

To answer your questions:

1. No - How do I create this reference?
2. I am opening a Form2 from Form1. I want to retrieve values from
variables stored in Form1 and put them on Form2.
3. I do not think the two forms are related. How do I set up a
relationship between the two?

Thanks,
-Dave

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:ebn$tea$EHA.2156@TK2MSFTNGP10.phx.gbl...
> We don't have enough information to answer your question yet.
>
> ? In the form you are coding in, do you have a reference to the form you
> want to get/set values for?
> ? Is the form you want to get/set to calling the second form or vice
> versa?
> ? How are the two forms related?
>
> Remember, there is nothing special about a "form" A form is really just
> another class. It has the same rule and regulation applied to it as and
> other class. You wouldn't try to access the members of a class that you
> don't have access to, so you can't do it to a "form class" either.
>
> Chris
>
>
>
> "Dave" <nospam@yahoo.com> wrote in message
> news:OIHkpYa$EHA.1260@TK2MSFTNGP12.phx.gbl...
>>I understand that I need to use a "Friend" declaration for these
>>variables, but I've searched all over the internet and can't figure out
>>how to retrieve and set the value of variables that are stored in forms
>>outside of the one I am coding in.
>>
>> Can somebody provide me with some direction or an example? Thank you
>> kindly.
>>
>> -Dave
>>
>
>



Relevant Pages

  • Re: How to pass information, classes between forms in Windows Application mode
    ... I don't think setting Form2 to inherit from Form1 will solve the ... problem without the use of a parametrical constructor, ... You're passing a reference to the object. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to pass information, classes between forms in Windows Application mode
    ... parametricized or parameter constructor, ... Form2: Form1 as you discuss below and as I further comment below. ... You're passing a reference to the object. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Urgent, plz help
    ... Then form1 has a reference to form2 but not the ... One way to over come that is to pass a reference to the object ... that you want to bind in form1 to the constructor of form2. ... write new constructor for form2 that take a textbox(textboxes). ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataSet Access
    ... I can't tell from your post if Form2 is loaded already when you make ... the update in form1 or not but it's somethign to look into. ... Then I reference can reference it from anywhere. ... breakpoint in Form2, verify the number. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to pass information, classes between forms in Windows Application mode
    ... purposes it's the same as the parameterized copy constructor, ... Another way is the inheritance of forms, Form2: ... Form1 as you discuss below and as I further comment below. ... Form2 from Form1 is not passing the true object but a copy of the ...
    (microsoft.public.dotnet.languages.csharp)