HI Andy,
Form2 is not designed to be shown in Taskbar.
I have taken an example from C# forums in other site to create a bool variable
as
andCode:public static bool IsOpen = false;
when the Form2 is being opened from Form1
the code is as below. When the user clicks on the product id on the datagrid it would bring up the Form2
The instance of Form2 shows up but when the focus is lost I cannot find the Form2 anywhere!Code:private void dgProducts_MouseUp(object sender, MouseEventArgs e) { System.Drawing.Point pt = new Point(e.X, e.Y); DataGrid.HitTestInfo hti = dgProducts.HitTest(pt); if(hti.Type == DataGrid.HitTestType.Cell) { dgProducts.CurrentCell = new DataGridCell(hti.Row, hti.Column); dgProducts.Select(hti.Row); sProductId = dgProducts[hti.Row,0].ToString(); if (sProdId != "") { if (!Form2.IsOpen) { Form2 frm2= new Form2(); frm2.sProdId = this.sProductId; frm2.Show(); } } } }




Reply With Quote