did anybody find a solution to his yet?
did anybody find a solution to his yet? I made a solution:
1) Use windows API to disable the form close button...
http://social.msdn.microsoft.com/Forums/en/sharepointinfopath/thread/257f186f-3ab3-4ac4-9553-f71d100ad2972) Disable the toolbars using code from google..
3) put a button on the form for the user to close the app
4) use Application.Exit() to quit InfoPath.
public void btnExit_Clicked(object sender, ClickedEventArgs e){
// your save code here.
//re-enable toolbars before you exit
HideAllToolbars(true);
//Exit App
Application.Quit();}
void HideAllToolbars(bool flag)
{
CommandBars myCommandBars = this.Application.ActiveWindow.CommandBars as CommandBars;
CommandBar myCommandBar = (this.Application.ActiveWindow.CommandBars as CommandBars).ActiveMenuBar;foreach (CommandBar item in myCommandBars)
{
//MessageBox.Show(item.Name.ToString() + " " + item.Type.ToString() + " " + item.Index.ToString());if (flag == true && (item.Type == MsoBarType.msoBarTypeMenuBar || item.Type == MsoBarType.msoBarTypeNormal))
{
item.Enabled = false;
}
}
}