Exemplo n.º 1
0
 protected override void OnTextChanged(EventArgs e)
 {
     base.OnTextChanged(e);
     try
     {
         if (!this.DesignMode && this._isInit)
         {
             ChooseList.Show(this, this.Text.Trim());
             this.InstallHook();
         }
     }
     catch { }
 }
Exemplo n.º 2
0
 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 { }
 }
Exemplo n.º 3
0
 void _hookMouse_OnMouseActivity(object sender, MouseEventArgs e)
 {
     if (e.Clicks > 0)
     {
         if (ChooseList.IsShow && !ChooseList.Bound.Contains(e.Location))
         {
             this.FindForm().Focus();
             ChooseList.HideSelf();
             this.UnInstallHook();
         }
         else if (PWCitysPanel.IsShow && !PWCitysPanel.Bound.Contains(e.Location))
         {
             this.FindForm().Focus();
             PWCitysPanel.HideSelf();
             this.UnInstallHook();
         }
     }
 }
Exemplo n.º 4
0
        public static void Show(Control control, string text)
        {
            if (text == string.Empty)
            {
                HideSelf();
            }
            else
            {
                if (Self == null)
                {
                    Self               = new ChooseList(control);
                    control.GotFocus  -= new EventHandler(control_GotFocus);
                    control.GotFocus  += new EventHandler(control_GotFocus);
                    control.LostFocus -= new EventHandler(control_LostFocus);
                    control.LostFocus += new EventHandler(control_LostFocus);
                    Self.ShowIcon      = false;
                    Self.ShowInTaskbar = false;
                    Self.TopMost       = true;
                    Self.Visible       = false;
                }
                Owner     = control;
                Self.Size = new Size(control.Width, 200);
                if (!Self.Visible)
                {
                    Self.Show();
                }
                Point point = control.PointToScreen(Point.Empty);
                Self.Location = new Point(point.X, point.Y + control.Height);
                Self.Search(text);
            }
            Form form = control.FindForm();

            if (form != null)
            {
                form.Activate();
                control.Select();
            }
        }
Exemplo n.º 5
0
 public ChooseListItemCollection(ChooseList owner)
     : this()
 {
     this._owner = owner;
 }
Exemplo n.º 6
0
 public static void Show(Control control, string text)
 {
     if (text == string.Empty)
     {
         HideSelf();
     }
     else
     {
         if (Self == null)
         {
             Self = new ChooseList(control);
             control.GotFocus -= new EventHandler(control_GotFocus);
             control.GotFocus += new EventHandler(control_GotFocus);
             control.LostFocus -= new EventHandler(control_LostFocus);
             control.LostFocus += new EventHandler(control_LostFocus);
             Self.ShowIcon = false;
             Self.ShowInTaskbar = false;
             Self.TopMost = true;
             Self.Visible = false;
         }
         Owner = control;
         Self.Size = new Size(control.Width, 200);
         if (!Self.Visible)
             Self.Show();
         Point point = control.PointToScreen(Point.Empty);
         Self.Location = new Point(point.X, point.Y + control.Height);
         Self.Search(text);
     }
     Form form = control.FindForm();
     if (form != null)
     {
         form.Activate();
         control.Select();
     }
 }