MFC对话框控件在运行时不可见 [英] MFC Dialog controls goes invisible while running
问题描述
hi
我创建了一个MFC应用程序。有时对话框中的控件(按钮,标签等)在运行时变得不可见。对话框形式仍然存在。这是一个随机问题。正常时间内对话框的截图和空白时都附有。有人帮我找到解决办法吗?
点击此处查看正常运行时对话框
点击此处查看空白运行时对话框
for显示/隐藏Dialog我使用以下代码
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
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(...)
{}
}
以下代码用于将对话框定位到窗口的右下角。这是在PopupDlg()之前调用的。
The following code was used to position the dialog to bottom right corner of the window.This is called before the PopupDlg()
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(...)
{}
}
谢谢
jayesh
Thanks
jayesh
推荐答案
调用Dialog类后使用UpadateWindow()方法。
use UpadateWindow() method after calling Dialog class.
这篇关于MFC对话框控件在运行时不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!