单击悬浮窗FlowMon时会弹出悬浮窗MainForm,如何让MainForm捕捉到FlowMon的位置进而在它的左上方显示呢?就是想把FlowMon的位置坐标传递给MainForm,从而决定MainForm的位置坐标。
FlowMon的初始化代码如下: private void FlowMon_Load(object sender, EventArgs e)
{
this.Show();
this.Top = 300;
this.Left = Screen.PrimaryScreen.Bounds.Width - 600;
this.Opacity = 1.0;
}MainForm的初始化代码如下: private void MainForm_Load(object sender, EventArgs e)
{
this.Show();
this.Top = 300;
this.Left =Screen.PrimaryScreen.Bounds.Width - 600;
this.Opacity = 1.0;
}
FlowMon的初始化代码如下: private void FlowMon_Load(object sender, EventArgs e)
{
this.Show();
this.Top = 300;
this.Left = Screen.PrimaryScreen.Bounds.Width - 600;
this.Opacity = 1.0;
}MainForm的初始化代码如下: private void MainForm_Load(object sender, EventArgs e)
{
this.Show();
this.Top = 300;
this.Left =Screen.PrimaryScreen.Bounds.Width - 600;
this.Opacity = 1.0;
}
Application.OpenForms["MainForm"].Location
if (frm == null)
{
MainForm frmMain = MainForm frmMain();
//在这设置属性也就像你所谓的坐标吧
}
else
{
MessageBox.Show("该窗体已存在....");
return;
}
这样的话MainForm就把FlowMon挡住了……我想获得FlowMon的(x,y)坐标,让MainForm在FlowMon的左上方,该怎么实现呢?