110,577
社区成员
发帖
与我相关
我的任务
分享
private void ToolStripFloatWindow_Load(object sender, EventArgs e)
{
this.hasCreated = true;
}
if (floatForm.HasCreated)
{
Point currentPt = new Point(floatForm.Location.X, floatForm.Location.Y);
Point minPt = this.tsPanel.PointToScreen(tsPanel.Location);
Point maxPt;
if (this.tsPanel.Height <= 20)
{
maxPt = new Point(minPt.X + this.tsPanel.Width, minPt.Y + 20);
}
else
{
maxPt = new Point(minPt.X + this.tsPanel.Width, minPt.Y + this.tsPanel.Height);
}
if ((currentPt.X > minPt.X) && (currentPt.X < maxPt.X) && (currentPt.Y > minPt.Y - 25) && (currentPt.Y < maxPt.Y - 25))
{
this.floatForm.Controls.Remove(this);
this.tsPanel.SuspendLayout();
this.tsPanel.Controls.Add(this);
this.Location = this.tsPanel.PointToClient(currentPt);
this.tsPanel.ResumeLayout();
this.floatForm.Dispose();
this.floatForm = null;
}
}