public void PopupLayer(Type type, object sender) { Control c = sender as Control; ToolStripItem item = sender as ToolStripItem; bool isShow; FloatLayerBase p = CreateLayer(type, out isShow); if (isShow) { if (c != null) { p.Show(c); } else { p.Show(item); } } else { var result = c != null?p.ShowDialog(c) : p.ShowDialog(item); txbResult.AppendText(result + "\r\n"); } }
private void label6_MouseHover(object sender, EventArgs e) { if (label6.Tag != null) { return; } FloatLayerBase p = CreateLayer(typeof(TipPopDemo)); label6.Tag = p; p.VisibleChanged += (a, b) => { if (!((a as Control).Visible)) { label6.Tag = null; } }; p.Show(label6, 0, label6.Height + 3); }