Inheritance: System.Windows.Forms.Form
コード例 #1
0
        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();
        }
コード例 #2
0
 private void HideList()
 {
     mouseHook.RemoveHook();
     isOpened = false;
     if (topForm != null)
     {
         topForm.Close();
         topForm = null;
     }
 }
コード例 #3
0
		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();
		}		
コード例 #4
0
		private void HideList()
		{
			mouseHook.RemoveHook();
			isOpened = false;
			if (topForm != null)
			{
				topForm.Close();
				topForm = null;
			}
		}