C++ MFC

Moderators: Lundin
Number of threads: 3354
Number of posts: 9032

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Buttons Posted by stylinarmo on 17 Mar 2003 at 5:46 PM
Hi , i just started an mfc sdi based app. I have multiple forms...however...in my main form...i have 4 buttons. I need to connect these buttons to the other forms...inex when the user clicks on button 1 it has to go to another form...How can i do this..

thanx
Report
Re: Buttons Posted by dperuso on 18 Mar 2003 at 10:27 AM
: Hi , i just started an mfc sdi based app. I have multiple forms...however...in my main form...i have 4 buttons. I need to connect these buttons to the other forms...inex when the user clicks on button 1 it has to go to another form...How can i do this..
:
: thanx
:
in your main application header file add the include the header file for the new forms class, and in the public or private area of your main application add the class and create an instance of the class for example I have a form that gets a password entered by the user,
the class is "CPassWord" and the instace is "m_CPassWord" so in my header file it looks like this CPassWord m_CPassWord; now in the main applications .cpp file I open the form in my application this way:

void CMy47t00028Dlg::OnbtnDefaultEdit()
{
// TODO: Add your control notification handler code here
m_CPassWord.DoModal();
if(m_CPassWord.PasswordOk == TRUE) m_CDefaultEdit.DoModal();
}

I would suggest to buy the book Teach yourself Visual C++ in 21 days, I think it's published by Sams




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.