MessageBox在Windows 7中未显示嵌入
-
08-10-2019 - |
题
考虑一个消息框,以提示用户回答是或否。它在我们的XP机器和一台Windows 7构建机器中起作用。
但是,它在我们的Windows 7嵌入式机器上不起作用。没有错误消息,没有显示消息框。它只是假设用户单击“是”按钮,因为我可以找到从那里创建的调试文件,并且 createDatabase();
在没有任何消息框的情况下被调用。
我可以找到消息框所需的汇编(System.windows.forms.dll)。它与我们的Windows 7 Build Machine位于同一位置。你知道为什么吗?谢谢
DialogResult result = System.Windows.Forms.MessageBox.Show(
"Do you want to update your database?\nWarning: All your data will be erased if you click Yes !",
"Update Database",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
string[] cmdLines2 = { @"C:\AndeDB\AndeDB.db is here and selected yes" };
//it will create, open and write or overwrite
File.WriteAllLines(@"C:\Temp\dbcheck2.txt", cmdLines2);
createDatabase();
}
其他提示
这里的关键字是“嵌入式”。这样的版本的窗口通常被配置为无头部(无监视器)或优化可工作的情况,而无需任何人接近。消息框是这种配置的毒品。机器停止运行,没有人能发现原因。
您需要返回系统构建器并找到控制此功能的选项。
不隶属于 StackOverflow