我正在使用Windows移动应用程序..确实如此 Microsoft.WindowsMobile.Samples.CECamera
当我捕获图像时,会出现一个对话框,告诉它已成功捕获,我应该单击“确定”。 在代码中,它使用这个ok点击继续保存图片... 现在我希望此消息停止显示。 或任何其他方法来自动点击该确定按钮。
if (DialogResult.OK == cameraCapture.ShowDialog())
{
string fileName = cameraCapture.FileName;
// If it is a video we rename the file so that it has the user entered
// default filename and the correct extension.
if (cameraCapture.Mode != CameraCaptureMode.Still)
{
string extension = fileName.Substring(fileName.LastIndexOf("."));
string directory = "";
if (fileName.LastIndexOf("\\") != -1)
{
directory = fileName.Substring(0, fileName.LastIndexOf("\\") + 1);
}
fileName = directory + this.textDefaultFileName.Text + extension;
System.IO.File.Move(cameraCapture.FileName, fileName);
}
// The method completed successfully.
MessageBox.Show("The picture or video has been successfully captured and saved to:\n\n" + fileName,
this.Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
}
}
答案 0 :(得分:1)
只需删除显示来自源的对话框的线(实际上,技术上是两行)。
通常,尝试自动点击您自己的应用程序中的按钮是一个非常糟糕的主意。
答案 1 :(得分:1)
如果是您的代码,只需编写自己的包含计时器的消息框类;这将是最好的解决方案。
如果其他人的代码显示了消息框,您可以:
答案 2 :(得分:0)
当我想要隐藏捕获对话框时,这种情况的解决方案
cameraDialog.Dispose();
在if语句结束后
if (DialogResult.OK == cameraCapture.ShowDialog())
{
//plapla
}
cameraDialog.Dispose();