Click here to Skip to main content
15,881,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I created a MFC application.Sometimes the controls(Button,Label etc) in the Dialog goes invisible at run time.The Dialog form remains.This is a random issue.The screenshots of the dialog in normal time and when goes blank are attached.Can anyone help me to find the solution for this ?

Click Here For the Normal Runtime Dialog

Click Here For the Blanked Runtime Dialog


for displaying/hiding the Dialog i used the following code

C++
void CVideoConverter::PopUpDlg(BOOL bValue)
 {

try
{
    if(bValue) // show
    {

        CVideoConverterApp::m_pCVideoConverterDlg->ShowWindow(SW_SHOWNORMAL);
        CVideoConverterApp::m_pCVideoConverterDlg->UpdateWindow();

    }
    else
    {// hide

        CVideoConverterApp::m_pCVideoConverterDlg->ShowWindow(SW_MINIMIZE);
    }
}
catch(...)
{}
}


The following code was used to position the dialog to bottom right corner of the window.This is called before the PopupDlg()

C#
void CVideoConverter::SetWindowToBottomRightCorner()
 {
   try
   {
      CRect rcScreen;
      SystemParametersInfo(SPI_GETWORKAREA, 0, (void *) &rcScreen, 0);
      CRect rcWindow;
      GetWindowRect(&rcWindow);
      MoveWindow(rcScreen.right - rcWindow.Width(), rcScreen.bottom - rcWindow.Height(),     rcWindow.Width(), rcWindow.Height(), TRUE);

  }

   catch(...)
  {}
}


Thanks

jayesh
Posted
Updated 10-Dec-14 18:44pm
v3

1 solution

use UpadateWindow() method after calling Dialog class.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900