Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

"Talking" to Second Form in VS 2005 EE

Posted on 2006-11-15
2
Medium Priority
?
185 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 560 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 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