Solved

"Talking" to Second Form in VS 2005 EE

Posted on 2006-11-15
2
179 Views
Last Modified: 2010-04-24
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
Comment
Question by:YoungBonzi
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 140 total points
ID: 17947173
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
 
LVL 8

Author Comment

by:YoungBonzi
ID: 17947301
Excellent, thank you!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question