Buttons - Programmers Heaven

Howdy, Stranger!

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

Categories

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.