MDI Child Form problem

  • Thread starter Thread starter Kalv
  • Start date Start date
K

Kalv

Hi,

I have produced a MDI application in C#. And basically i produce a
child form from the container and then i produce another child from
that child.

I do this by (code in child frmCustomers)
frmCustomerSummary = new frmMatchSummary(....);
frmCustomerSummary.MDIParent = this.MDIParent;
frmCustomerSummary.Show();

This all works fine and the form is displayed as a MDI child But It's
not in focus, the title bar is not selected, although it is at the top
of the other forms. The frmCustomers that produced the child form is
selected, the only way to gain focus is click off and then back on
again.

I have tried .activate(), and it still doesn't still work.

What am i doing wrong?

Kalv
 
Check frmCustomers(Summary) if any of its TopMost property is set to True,
or maybe you have an event which performs (usualy refresh datagrid/dataset)
actions that focus back the parent. I had the same problem, and that was the
issue. Normally, any created new form whose .Show() method is called, will
be displayed on top and focused, wether it's a MDI or not, unless you have
TopMost set to some toher forms.

Hope this helps.
 
Hey, thanks for the reply, the TopMost property is not set on any of the
forms. on the frmCustomers form there is an activeX web Browser but also
on the new frmCustomerSummary that is opened.

The MDI window list that i have displayed under a menu indicates that
the new frmCustomerSummary that is opened is active as it has a tick
against it.

Very Wierd...
 
Back
Top