c# - Message BOX not showing up on InfoPath form -
the message box should appear when view switched on form screen comes blank? i'm not sure why. tried adding reference windows.forms
well
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 object using class return (messagebox.show(string1, string2, button)); } } }
you should use following
messagebox.show("display error message text here", "title appears on messagebox here", messageboxbuttons.yesno);
also google how use string.format or string.join or string.concat message
Comments
Post a Comment