Пример #1
0
        /// <summary>
        /// Creates a new control instance.
        /// </summary>
        public NotificationBox()
        {
            // Suspend the layout.
            this.SuspendLayout();

            // Set the theme color table.
            this.colorTable = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).ColorTable : ThemeColorTable.DefaultColorTable;

            // Default properties.
            this.Width = NotificationBox.defaultWidth;
            this.Height = NotificationBox.defaultHeight;
            this.Margin = new Padding(10);
            this.Padding = new Padding(16, 8, 16, 16);
            this.Visible = false;
            this.DoubleBuffered = true;
            this.BackColor = this.colorTable.NotificationBoxBackground;

            // Default components.
            this.progressBar.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
            this.progressBar.Size = new Size(this.Width - this.Padding.Left - this.Padding.Right, 17);
            this.progressBar.Location = new Point(this.Padding.Left, this.Bottom - this.Padding.Bottom - this.progressBar.Height);
            this.progressBar.MarqueeAnimationSpeed = 10;
            this.progressBar.Style = ProgressBarStyle.Marquee;
            this.progressBar.Visible = false;

            // Set the timer event handler.
            this.timer.Tick += this.OnTick;

            // Add the controls.
            this.Controls.Add(this.progressBar);

            // Resume the layout.
            this.ResumeLayout();
        }
Пример #2
0
        /// <summary>
        /// Creates a new control instance.
        /// </summary>
        public ToolSplitContainer()
        {
            // Set the theme color table.
            this.colorTable = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).ColorTable : ThemeColorTable.DefaultColorTable;

            this.Panel1.Padding = new Padding(1);
            this.Panel2.Padding = new Padding(1);

            this.Panel1.Paint += this.OnPanelPaint;
            this.Panel2.Paint += this.OnPanelPaint;

            this.SplitterWidth = 5;
        }
Пример #3
0
        /// <summary>
        /// Creates a new notification form instance.
        /// </summary>
        public NotificationForm()
        {
            // Suspend the layout.
            this.SuspendLayout();

            // Set the theme color table.
            this.colorTable = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).ColorTable : ThemeColorTable.DefaultColorTable;

            // Default properties.
            this.FormBorderStyle = FormBorderStyle.None;
            this.Width = NotificationForm.defaultWidth;
            this.Height = NotificationForm.defaultHeight;
            this.Padding = new Padding(16, 8, 16, 16);
            this.DoubleBuffered = true;
            this.BackColor = this.colorTable.NotificationBoxBackground;
            this.StartPosition = FormStartPosition.CenterParent;
            this.ShowInTaskbar = false;
            this.ShowIcon = false;

            // Default components.
            this.button.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.button.Size = new Size(75, 23);
            this.button.Location = new Point(this.Right - this.Padding.Right - this.button.Width, this.Bottom - this.Padding.Bottom - this.button.Height + 3);
            this.button.Visible = false;
            this.button.Text = "&Cancel";

            this.progressBar.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
            this.progressBar.Size = new Size(this.Width - this.Padding.Left - this.Padding.Right - this.button.Width - 10, 17);
            this.progressBar.Location = new Point(this.Padding.Left, this.Bottom - this.Padding.Bottom - this.progressBar.Height);
            this.progressBar.MarqueeAnimationSpeed = 10;
            this.progressBar.Style = ProgressBarStyle.Marquee;
            this.progressBar.Visible = false;

            // Set the timer event handler.
            this.timer.Tick += this.OnTick;

            // Add the controls.
            this.Controls.Add(this.progressBar);
            this.Controls.Add(this.button);

            // Apply the window font.
            Window.SetFont(this);

            // Resume the layout.
            this.ResumeLayout();
        }