Regarding the scope when working with forms in .NET C#

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: GP (GP_at_discussions.microsoft.com)
Date: 06/17/04


Date: Thu, 17 Jun 2004 15:27:02 -0700

I am having the scope problem,I have two forms form1 and form2.
Form1 has two textboxes and they is a procedure called
public void callme()
{
text1.Text="Check"
}

In form2 when I try to reference this callme ,it say it need to be static procedure.
but when it's static .I get a error text1.text is nonstatic member reference.
How can I call a procedure from form2 to form1 that has reference to the controls .
Can some please help me in this regards,
Thanks
GP



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: 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)