Exemplo n.º 1
0
 public void ClickSelect(int index)
 {
     if (this.SelectedIndex != index)
     {
         if (IsDropDown)
         {
             SUIMouse.MouseClick(this, this.Width - this.X - 5, (this.Height - this.Y) / 2);
         }
         else
         {
             this.Focus();
         }
         int offset = index - this.SelectedIndex;
         if (offset > 0)
         {
             for (int i = 0; i < offset; i++)
             {
                 SUIKeyboard.Type(SUI.Base.Win.SUIKeyboard.VK.DOWN);
             }
         }
         else
         {
             offset = Math.Abs(offset);
             for (int j = 0; j < offset; j++)
             {
                 SUIKeyboard.Type(SUI.Base.Win.SUIKeyboard.VK.UP);
             }
         }
         SUISleeper.Sleep(500);
         if (IsDropDown)
         {
             SUIKeyboard.Type(SUI.Base.Win.SUIKeyboard.VK.RETURN);
         }
     }
 }
Exemplo n.º 2
0
        public void ShowShortCutIndicators()
        {
            //Only if we are working on a dialog, indicators are supposed to display.
            if (IsDialog)
            {
                SUIKeyboard.Type(SUIKeyboard.VK.MENU);
                //Type "Alt" key for twice to ensure that we could see indicators.
                SUIKeyboard.Type(SUIKeyboard.VK.MENU);

                SUISleeper.Sleep(1000);
            }
        }
Exemplo n.º 3
0
        public void TypeText(string str)
        {
            SUIMouse.MouseClick(this, (int)((Width - X) / 2), (int)((Height - Y) / 2));

            //Clear exsting text.
            SUIKeyboard.Press(SUIKeyboard.VK.CONTROL);
            SUIKeyboard.Type(SUIKeyboard.VK.HOME);
            SUIKeyboard.Release(SUIKeyboard.VK.CONTROL);

            int textLeng = Text.Length;

            for (int i = 0; i < textLeng; i++)
            {
                SUIKeyboard.Type(SUIKeyboard.VK.DELETE);
            }

            SUIKeyboard.Type(str);
        }
Exemplo n.º 4
0
 public void Close()
 {
     SUIWinAPIs.SendMessage(this.hwnd, SUIMessage.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
     SUIKeyboard.Type(SUIKeyboard.VK.CONTROL);   //control key
 }