Hello everyone,
I'm working on a Word 2007 add-in and is using VS 2005 (C#). The add-in contains windows forms that are displayed whenever a button was clicked on the ribbon. I'm loading the forms using the below line of code.
myForm.ShowDialog();
When a command button was clicked on the currently loaded windows form, it will unload itself and load a new form. Below is the lines of code I'm using.
cmdButton_Clicked(/*function parameters here*/)
{
/*** other lines of codes exist here ***/
this.Hide(); //Hide the currently loaded form
showMyOtherForm(); //Function to show my other form
}
void ShowMyOtherForm()
{
/*** other lines of codes exist here ***/
myOtherForm.ShowDialog();
}
The code executes without error, the currently loaded form is hiding and myOtherForm is also loading but it's not modal. I want to to show myOtherForm to be modal and it's parent is MS Word. Please let me know how to accomplish this.
Thanks in advance!