Thread: Accessing other forms

  1. #1
    Registered User
    Join Date
    Sep 2006

    Accessing other forms

    How can I, from form1's code, access form2, to for example change the title of form2 etc? I type in "form2.", and the options it brings up having nothing to do with changing the properties of form2. Please help! (I'm using C# 2005 express).

  2. #2
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003
    you can create a public function in form2 to do whatever you want so you can call it and send it whatever, like if you have a label in form 2 you could create a public SetLabel(string) function in form 2 and then call it from form 1 by calling

    form2.SetLabel("new label text");
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

  3. #3
    Registered User
    Join Date
    Sep 2006
    Ok thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2009, 04:40 AM
  2. prob with multiple forms accessing header file
    By silkyt in forum Windows Programming
    Replies: 7
    Last Post: 11-03-2007, 04:14 PM
  3. C# Game using Forms
    By ejohns85 in forum C# Programming
    Replies: 1
    Last Post: 12-16-2006, 05:35 PM
  4. Two forms showing at once
    By Tperry23 in forum C# Programming
    Replies: 0
    Last Post: 06-07-2005, 11:51 PM
  5. accessing windows forms textbox properties
    By luigi40 in forum C# Programming
    Replies: 5
    Last Post: 04-19-2005, 04:53 PM