コード例 #1
0
ファイル: UpdateForm.cs プロジェクト: muskit/EZBlocker2
        public UpdateForm()
        {
            InitializeComponent();

            movement = new CustomMovement(this);
            movement.Exclude(typeof(Button));
            movement.SetMovement(Controls);
        }
コード例 #2
0
        /* Constructor */
        public MainForm()
        {
            InitializeComponent();

            try
            {
                Point point = new Point(Convert.ToInt32(Properties.Settings.Default.PositionX), Convert.ToInt32(Properties.Settings.Default.PositionY));
                Location = point;
            }
            catch
            {
                StartPosition = FormStartPosition.CenterScreen;
            }

            // set keydown event
            SetCustomEvent(Controls);

            movement              = new CustomMovement(this);
            movement.NewPosition += SaveLocation;

            movement.Exclude(typeof(Button));
            movement.Exclude(typeof(CheckBox));
            movement.Exclude(typeof(LinkLabel));

            movement.SetMovement(Controls);

            contextMenuStrip.Renderer = new CustomToolStripRenderer();

            titleLabel.Text = "v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            if (IsAdmin)
            {
                titleLabel.Text += " - Admin mode";
                string checkBoxBlockAdsToolTip = toolTip.GetToolTip(checkBoxBlockAds);
                toolTip.SetToolTip(checkBoxBlockAds, checkBoxBlockAdsToolTip.Substring(0, checkBoxBlockAdsToolTip.IndexOf('(') - 1));
            }

            labelMessage.UseMnemonic = false; // display the ampersand character

            if (Properties.Settings.Default.StartMinimized)
            {
                HideEZBlocker();
            }

            // Create .ini config file on first startup so the user can modify Client Id+Secret
            Properties.Settings.Default.Save();
        }