• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

"Talking" to Second Form in VS 2005 EE

Hello,

I have Form1 (the default form for Windows Forms Application projects) and Form2 (a second form that I added to the project). How can I access Form2's functions and controls from Form1?

I've tried:

myProjectName::Form2::aFunction(); //doesn't work.

---

Form^ formTwo = gcnew Form2();
formTwo->(the functions or controls don't show up...)

-----------

Thanks for any advice! (wish I had more points to offer)
0
YoungBonzi
Asked:
YoungBonzi
1 Solution
 
AlexFMCommented:
Form2^ formTwo = gcnew Form2();          // Form2 and not Form
formTwo->AnyPublicNonStaticFunction();   // set real function name here

This is right way.
Except of this, VC++ 2005 has annoying Intellisence problems - Intellisence is updated slowly, and after it is updated, it works only sometimes. Don't beleive to Intellisence if it is not opened sometimes, and type manually. Or buy Visual Assist :(
0
 
YoungBonziAuthor Commented:
Excellent, thank you!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now