RE: Urgent, plz help

From: Mohamoss (mohamed.mossad_at_egdsc.microsoft.com)
Date: 03/30/04


Date: Tue, 30 Mar 2004 16:32:44 GMT

Hi
If form one is the caller of form two . I.e. you create and open from2
somewhere inside form1. Then form1 has a reference to form2 but not the
opposite. 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. you have to
write new constructor for form2 that take a textbox( textboxes) . on form1
while creating form2 pass reference to the textboxes that will be binded
from form one .
 So you will do something like this
      Form2 theotherform = new Form2 ( this.whatevertextbox , ……)
Then in form two save these references in some object just to bind later.
 This is not a good solution whoever since this will cause a circular
reference which means bad design
Why don't you send the query result to form1 some way, then you can do the
binding from there.
hope that helps,
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC



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: NEWBIE - Accessing Variables stored in another form
    ... No - How do I create this reference? ... I am opening a Form2 from Form1. ... I want to retrieve values from ...
    (microsoft.public.dotnet.languages.vb)
  • 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: 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: Form calling form problem
    ... input thru a couple of textboxes and returns ... >>While editing the controls in a form (form1) ... >>form (form2) which returns a value. ...
    (microsoft.public.fox.programmer.exchange)

Loading