Form BringToFront Effect

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've developed a series of Windows forms in a pocket PC application. I
created a listView that constains a list of form names. When you select one
of the form names from the listView, it brings that form to the front, i.e.
the form covers the listView form. It works as expected except when you click
the form, it flips back to the listView form. The form comes back to the
front until you manually select the form name from the iTask list. Can anyone
tell me what I have missed.

The following is the code sample:

foreach( ListViewItem chkItem in listView1.Items )
{
if( chkItem.Selected )
{
formName = chkItem.Text.ToString();

Form frm = dh.GetFormObject(formName);
frm.BringToFront();

break;
}
}

Application.DoEvents();
 
Hi, Peter,

Thanks for the reply. I've tried frm.Focus(). The problem stays. Once I
click the screen, it flips back again. The form does not even response the
OnClick event.

I must miss something else.

Robert
 
Back
Top