2010-11-11 23 views
5

显示考虑一个消息框来提示用户是或回答没有。它适用于我们的XP机器和一台Windows 7构建机器。消息框不会在Windows 7嵌入式

但是,它并没有我们的Windows 7嵌入式机器上工作。没有错误信息,没有MessageBox出现。它只是假定用户点击了“是”按钮,因为我可以找到从那里创建的调试文件,并且createDatabase();在没有任何消息框的情况下被调用。

我可以找到其通过在MessageBox所需的组件(System.Windows.Forms.dll中)。它与我们的Windows 7构建机器位于相同的位置。你有什么想法为什么?感谢

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(); 
} 

回答

5

this后,你可以从Windows 7嵌入式禁用“消息框默认回复”的组成部分。更多详情请见msdn

+0

可以ü适用于Windows XP共享解决方案请? – 2012-12-07 16:07:01

4

这里的关键词是“内嵌式”。这种版本的Windows通常配置为无人运行(无显示器)或优化工作而无需人员关闭。 MessageBox对这样的配置是有害的。机器停止运行,没有人可以找出原因。

您需要返回到系统构建器并找到控制此选项的选项。