protected virtual void ShowList()
        {
            if (popup.Visible == false)
            {
                list.SelectedIndex = -1;
                UpdateList();
                Point p = PointToScreen(new Point(0, 0));
                p.X           += PopupOffset.X;
                p.Y           += Height + PopupOffset.Y;
                popup.Location = p;

                if (list.Items.Count <= 0)
                {
                    return;
                }

                popup.Show();
                if (hook == null)
                {
                    hook = new WinHook(this);
                    var findForm = FindForm();
                    if (findForm != null)
                    {
                        hook.AssignHandle(findForm.Handle);
                    }
                }
                Focus();
            }
            else
            {
                UpdateList();
            }
        }
Esempio n. 2
0
 protected virtual void ShowList()
 {
     if (popup.Visible == false)
     {
         list.SelectedIndex = -1;
         UpdateList();
         Point p = PointToScreen(new Point(0, 0));
         p.X           += PopupOffset.X;
         p.Y           += Height + PopupOffset.Y;
         popup.Location = p;
         if (list.Items.Count > 0)
         {
             popup.Show();
             if (hook == null)
             {
                 hook = new WinHook(this);
                 hook.AssignHandle(FindForm().Handle);
             }
             Focus();
             SelectionStart = Text.Length;
         }
     }
     else
     {
         UpdateList();
     }
 }
Esempio n. 3
0
        protected virtual void ShowList()
        {
            if (popup.Visible == false) {
                list.SelectedIndex = -1;
                UpdateList();
                Point p = PointToScreen(new Point(0, 0));
                p.X += PopupOffset.X;
                p.Y += Height + PopupOffset.Y;
                popup.Location = p;
                if (list.Items.Count > 0) {
                    popup.Show();
                    if (hook == null) {
                        hook = new WinHook(this);
                        hook.AssignHandle(FindForm().Handle);
                    }
                    Focus();
                    SelectionStart = Text.Length;
                }

            }
            else {
                UpdateList();
            }
        }