Paul
Thanks for the reply.
I think I figured out what the problem was - a buggy(by design maybe??)
component.
I am using this third party drop down component, that basically creates
a new form on the dropdownclick event. The component uses a strange
logic to decide its parent, and that's what was causing the problem.
However, now I am having another problem.
I think its best to describe it with code, as you suggested.
In MainForm.cs:
try
{
OutlookSynchTool tool = new
OutlookSynchTool(OutlookSynchMode.Normal);
tool.Owner = this;
tool.InitializeGrid(); // this method call does loads the grid in
the form with data
tool.TopMost = true;
tool.ShowDialog(this);
}
OutlookSynchTool is extended from System.Windows.Forms.Form.
In the OutlookSynchTool class, there is call to the second dialog:
LinkNewContactToEntityDialog linkdialog = new
LinkNewContactToEntityDialog(mContactsToLink);
linkdialog.TopMost = true;
mLinkEntityToContactDelegate = new
LinkEntityToContactDelegate(linkdialog.ShowDialog);
if (InvokeRequired)
{
linkdialog.Invoke(mLinkEntityToContactDelegate, new object[1]
{this});
}
else
{
linkdialog.ShowDialog(this);
}
OutlookSynchTool is modal to MainForm. LinkNewContactToEntityDialog is
modal to OutlookSynchTool. When the input focus is in
LinkNewContactToEntityDialog, I can still interact with the
OutlookSynchTool dialog. I reckon this should be impossible, because of
the modal-ness - but ofcourse I am wrong.
Is this too confusing? Am I missing something?
Regards
Harsh