コード例 #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);
        }
コード例 #2
0
 private void ctxItemStartup_Click(object sender, EventArgs e)
 {
     ctxItemStartup.Checked = WinFormHelper.CreateShortcut(_startupPathName, !ctxItemStartup.Checked);
 }