tags:

views:

252

answers:

1

Hi

I have a simple winforms application, on performing operations it shows a child window everytime. If I open a browser window (fully maximized) or some other window as usual the application goes back with its childwindow, on clicking the exe which is in the taskbar only the child window gets visible,but the application window doesn't come into view. I want to know how to show both the windows when I select it from taskbar.

childwindow is also a winform,whose toplevel property is set as true,apart from it nothing is new(JUST BY CLICKING A BUTTON OR CELL IN GRID I CREATE AN OBJECT FOR THE FORM AND USES IT SHOW PROPERTY TO SHOW)

 AlertMsgWindow _alertMsg;
    void dataGridViewAlerts_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        try
        {
            if (!string.IsNullOrEmpty(this.dataGridViewAlerts.getValue(0, this.dataGridViewAlerts.SelectedRow)))
            {
                this.dataGridViewAlerts.setCellImage(0, this.dataGridViewAlerts.SelectedRow, "NewsIconRead");

                if (_alertMsg == null || _alertMsg.IsDisposed)
                {
                    if (_alertMsg != null)
                    {
                        _alertMsg.onDeleteMessageRequest -= new DeleteMessage(_alertMsg_onDeleteMessageRequest);
                        _alertMsg.Dispose();
                    }
                    _alertMsg = new AlertMsgWindow();
                    _alertMsg.onDeleteMessageRequest += new DeleteMessage(_alertMsg_onDeleteMessageRequest);                       
                }

                _alertMsg.FillDetails(alertDetails[IDcollection[this.dataGridViewAlerts.SelectedRow]]);
                if (!_alertMsg.Visible)
                {                        
                    _alertMsg.Location = PointToScreen(new Point(this.Width / 4, -this.Height));                        
                    _alertMsg.Show(this);
                }

                if (onReadMessageReq != null)
                    onReadMessageReq(IDcollection[this.dataGridViewAlerts.SelectedRow]);
            }
        }
        catch (Exception)
        { }
    }              

Note: THIS IS HAPPENING ONLY IN WINDOWS2000

I used a component named Dotnetmagic.dll,i dont know whether it causes the problem.can somebody helps me to solve this

+1  A: 
I replaced these lines 

_alertMsg.Location = PointToScreen(new Point(this.Width / 4, -this.Height));
With

_alertMsg.Left = x; _alertMsg.Top = y;

and it solved my problem

karthik