C# InfoPath表单上未显示消息框
在窗体上打开视图但屏幕显示为空白时,消息框应出现?我不知道为什么。我还尝试添加对C# InfoPath表单上未显示消息框,c#,messagebox,infopath,C#,Messagebox,Infopath,在窗体上打开视图但屏幕显示为空白时,消息框应出现?我不知道为什么。我还尝试添加对Windows.Forms的引用 using Microsoft.Office.InfoPath; using System; using System.Xml; using System.Windows.Forms; using System.Xml.XPath; namespace Form1 { public partial class FormCode { public
Windows.Forms
的引用
using Microsoft.Office.InfoPath;
using System;
using System.Xml;
using System.Windows.Forms;
using System.Xml.XPath;
namespace Form1
{
public partial class FormCode
{
public void InternalStartup()
{
}
public static DialogResult FormEvents_ViewSwitched(object sender, ViewSwitchedEventArgs e)
{
string string1 = "Error";
string string2 = "Empty field found on form";
// Set button of type "MessageBoxButton"
MessageBoxButtons button = MessageBoxButtons.YesNo;
// Static method, referenced without an object but just using the class
return (MessageBox.Show(string1, string2, button));
}
}
}
您应该使用以下命令
MessageBox.Show("Display Error Message Text Here", "Title that appears on MessageBox here", MessageBoxButtons.YesNo);
另外,在谷歌上搜索如何使用string.Format或string.Join或string.Concat处理您的邮件您应该使用以下命令
MessageBox.Show("Display Error Message Text Here", "Title that appears on MessageBox here", MessageBoxButtons.YesNo);
另外,用谷歌搜索如何在邮件中使用string.Format或string.Join或string.Concat完全删除MesageBoxButtons并尝试以下
返回(MessageBox.Show(string1、string2、MessageBoxButtons.YesNo)时会发生什么
仍然没有发生任何事情。但是,视图切换,消息框现在确实出现。至少我修复了消息框未正确显示的第一个/初始问题。如果完全删除MesageBoxButtons并尝试以下返回(MessageBox.Show(string1、string2、MessageBoxButtons.YesNo)会发生什么情况
仍然没有发生任何事情。视图切换,但是消息框现在确实出现了。至少我修复了消息框显示不正确的第一个/初始问题。