Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Buttons

stylinarmostylinarmo Posts: 7Member
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

Comments

  • dperusodperuso Posts: 55Member
    : 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

Sign In or Register to comment.