Thread: stupid problem in Dialog based Apps by MFC

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    8

    Talking stupid problem in Dialog based Apps by MFC

    Hi there
    I have a dialog based app.,and I placed an SSTab on my dialog form.then I planed to place a frame on the first tab of SSTab and a text edit control in htis frame.but iI saw that the frame and edit box controls apear in the second tab too.so I wrote this code in the TCL_SELCHANGE message event of the SSTab.It works well now,but i think there is a simple way for this and I don't like this stupid solving way.
    my codes:

    void CTxRxDlg::OnSelchangeMainTab(NMHDR* pNMHDR, LRESULT* pResult)
    {
    if (m_MainTab.GetCurFocus()==1)
    {
    m_frmFile.EnableWindow(FALSE);
    m_edtFile.EnableWindow(FALSE);
    m_frmFile.ShowWindow(SW_HIDE);
    m_edtFile.ShowWindow(SW_HIDE);
    }
    else
    {
    m_frmFile.EnableWindow(TRUE);
    m_edtFile.EnableWindow(TRUE);
    m_frmFile.ShowWindow(SW_SHOW);
    m_edtFile.ShowWindow(SW_SHOW);
    }
    *pResult = 0;
    }

    Now dears,is there any simple and pure way to solve this problem?(if can call it problem)

    Thanks in advance

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Here is one solution.

    Code:
    bool bStatus = m_MainTab.GetCurFocus() == 1;
    DWORD state = m_MainTab.GetCurFocus() == 1  ? SW_HIDE : SW_SHOW;
    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. shell problem
    By ArXi in forum Linux Programming
    Replies: 2
    Last Post: 06-04-2009, 02:30 AM
  2. MFC problem
    By gadu in forum Windows Programming
    Replies: 5
    Last Post: 05-29-2009, 06:33 AM
  3. Creating a Dialog Based Application without MFC
    By MitchellH in forum C++ Programming
    Replies: 8
    Last Post: 05-21-2005, 10:02 AM
  4. a real beginner in Visual C++.net - Q about dialog problem
    By Green Fuze in forum Windows Programming
    Replies: 3
    Last Post: 03-01-2005, 05:24 AM
  5. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08:52 PM