Beispiel #1
0
        public TranslateForm()
        {
            InitializeComponent();

            //this.AutoSize = true;
            this.StartPosition   = FormStartPosition.Manual;
            this.ShowInTaskbar   = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            selectedText = Hook.getSelection();
            Console.WriteLine("select " + selectedText);
            translatedText = DictParser.getTranslateFromNaverAPI(selectedText);

            translatedTB.ReadOnly    = true;
            translatedTB.BorderStyle = 0;
            translatedTB.BackColor   = this.BackColor;
            translatedTB.TabStop     = false;

            Action handler = null;

            handler = () =>
            {
                MultiKeyGesture.keyUpEvent -= handler;
                this.Close();
            };

            MultiKeyGesture.keyUpEvent += handler;

            if (MultiKeyGesture.bMatched == false)
            {
                MultiKeyGesture.keyUpEvent -= handler;
                return;
            }

            this.Show();
            Application.Run();
        }