Solved

"Talking" to Second Form in VS 2005 EE

Posted on 2006-11-15
2
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: 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.

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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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