private void ShowList() { if (ListOpening != null) { ListOpening.Invoke(this, null); } isOpened = true; topForm = new TpTopMostForm(); topForm.Deactivate += (sender, args) => HideList(); int a = topForm.Height; int b = Screen.PrimaryScreen.Bounds.Height; Point c = PointToScreen(new Point(0, Height)); topForm.Controls.Add(_innerList); _innerList.Location = new Point(0, 0); bool t = _innerList.Focus(); topForm.Size = _innerList.Size; if (PointToScreen(new Point(0, Height)).Y + topForm.Height > Screen.PrimaryScreen.Bounds.Height) { topForm.Location = PointToScreen(new Point(0, -topForm.Height)); } else { topForm.Location = PointToScreen(new Point(0, Height)); } mouseHook.SetHook(); topForm.ShowDialog(); }
private void HideList() { mouseHook.RemoveHook(); isOpened = false; if (topForm != null) { topForm.Close(); topForm = null; } }
private void ShowList() { if (ListOpening != null) ListOpening.Invoke(this, null); isOpened = true; topForm = new TpTopMostForm(); topForm.Deactivate += (sender, args) => HideList(); int a = topForm.Height; int b = Screen.PrimaryScreen.Bounds.Height; Point c = PointToScreen(new Point(0, Height)); topForm.Controls.Add(_innerList); _innerList.Location = new Point(0, 0); bool t = _innerList.Focus(); topForm.Size = _innerList.Size; if (PointToScreen(new Point(0, Height)).Y + topForm.Height > Screen.PrimaryScreen.Bounds.Height) topForm.Location = PointToScreen(new Point(0, -topForm.Height)); else topForm.Location = PointToScreen(new Point(0, Height)); mouseHook.SetHook(); topForm.ShowDialog(); }