Exemplo n.º 1
0
        public DesktopDictionary()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;
            //threadStart = Search;
            Region = Region.FromHrgn(WinFormHelper.CreateRoundRectRgn(0, 0, Width = _width[1], Height = _height[1], 10, 10));

            _clm         = (ToolStripMenuItem)ctxItemColor.DropDownItems[Settings.Default.Color] ?? ctxItemColorLime;
            _tsm         = (ToolStripMenuItem)ctxItemTransparent.DropDownItems[Settings.Default.Transparency] ?? ctxItemTransparent0;
            _dcb         = btnEn;
            txtWord.Text = Settings.Default.Welcome ?? "welcome";

            _clm.Checked    = true;
            BackgroundImage = _clm.BackgroundImage;

            _tsm.Checked = true;
            Opacity      = Convert.ToDouble(_tsm.Tag, new NumberFormatInfo {
                NumberDecimalSeparator = "."
            });

            WinFormHelper.Appname = Assembly.GetExecutingAssembly().FullName.Remove(Assembly.GetExecutingAssembly().FullName.IndexOf(","));
            _startupPathName      = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), WinFormHelper.Appname + ".lnk");

            ctxItemStartup.Checked   = WinFormHelper.CreateShortcut(_startupPathName, Settings.Default.RunAtStartup);
            ctxItemAlwaysTop.Checked = (TopMost = Settings.Default.AlwaysOnTop);
        }
Exemplo n.º 2
0
 private void Form1_Deactivate(object sender, EventArgs e)
 {
     Location = new Point(Location.X + (Width - _width[1]), Location.Y);
     Region   = Region.FromHrgn(WinFormHelper.CreateRoundRectRgn(0, 0, Width = _width[1], Height = _height[1], 10, 10));
     Opacity  = Convert.ToDouble(_tsm.Tag, new NumberFormatInfo {
         NumberDecimalSeparator = "."
     });
     txtTranslation.Clear();
 }
Exemplo n.º 3
0
        private void ShowTextArea(string text)
        {
            txtTranslation.Rtf = text;

            if (Height == _height[1])
            {
                Region   = Region.FromHrgn(WinFormHelper.CreateRoundRectRgn(0, 0, Width = _width[0], Height = _height[0], 10, 10));
                Location = new Point(Location.X - (Width - _width[1]), Location.Y);
            }

            Activate();
            txtWord.Focus();
            txtWord.SelectAll();
            txtTranslation.Focus();
            Opacity = 1;
            UpdateStyles();
            //txtTranslation.ForceRefresh();
        }