Simple user interface in winforms

I have a simple winforms application, when performing operations, it each time shows a child window. If I open a browser window (fully maximized) or some other window, as usual, the application returns with a child window by clicking on exe, which is on the taskbar, only the child window becomes visible, but the application window does not appear. I want to know how to show both windows when I select it from the taskbar.

childwindow is also a winform whose top-level property is set to true, nothing new except it (JUST BY CLICKING A BUTTON OR CELL IN THE NETWORK I CREATE AN OBJECT FOR THE FORM AND USES THIS SHOW PROPERTY 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 CONTINUES ONLY ON WINDOWS2000

Dotnetmagic.dll, , . - .

+3
1
I replaced these lines 

_alertMsg.Location = PointToScreen ( (this.Width/4, -this.Height))

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

+1

Source: https://habr.com/ru/post/1766937/


All Articles