コード例 #1
0
ファイル: CityTextBox.cs プロジェクト: mythslove/12306-1
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     try
     {
         if (!this.DesignMode)
         {
             this.MouseIcon = EMouseState.MouseUp;
             if (e.Button == MouseButtons.Left && this.IconRect.Contains(e.Location))
             {
                 ChooseList.HideSelf();
                 PWCitysPanel.Show(this);
                 this.InstallHook();
             }
         }
     }
     catch { }
 }
コード例 #2
0
ファイル: PWCitysPanel.cs プロジェクト: mythslove/12306-1
        public static string Show(Control owner)
        {
            if (owner == null)
            {
                throw new Exception("owner is null!");
            }
            Self._owner = owner;
            int xPos = owner.RectangleToScreen(Rectangle.Empty).X;
            int yPos = owner.RectangleToScreen(Rectangle.Empty).Y + Self._owner.Height + 5;

            Self.TopMost = true;
            if (!Self.Visible)
            {
                Self.Show();
            }
            Self.Location = new Point(xPos, yPos);
            owner.Select();
            return(string.Empty);
        }