Solved

"Talking" to Second Form in VS 2005 EE

Posted on 2006-11-15
2
176 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now