示例#1
0
        public StartButton(SecondaryTaskbar mainForm)
        {
            InitializeComponent();

            _mainForm          = mainForm;
            this.Font          = new System.Drawing.Font(Font, FontStyle.Bold);
            _state             = State.Normal;
            this.Load         += new EventHandler(StartButton_Load);
            this.ShowInTaskbar = false;
        }
示例#2
0
        private void CalculatePosition(SecondaryTaskbar form)
        {
            var taskbarLocation = form.TaskbarLocation;

            if (Native.IsThemeActive() == 0)
            {
                if (taskbarLocation == Win32.Native.ABEdge.Top)
                {
                    this._location = new Point(form.Location.X + 2, form.Location.Y + 3);
                }
                else if (taskbarLocation == Win32.Native.ABEdge.Bottom)
                {
                    this._location = new Point(form.Location.X + 2, form.Location.Y + 4);
                }
                else if (taskbarLocation == Native.ABEdge.Right)
                {
                    this._location = new Point(form.Location.X + 3, form.Location.Y + 3);
                }
                else
                {
                    this._location = new Point(form.Location.X + form.Width - this.Width - 2, form.Location.Y + 3);
                }
            }
            else
            {
                if (taskbarLocation == Win32.Native.ABEdge.Top ||
                    taskbarLocation == Win32.Native.ABEdge.Bottom)
                {
                    int yoffset = 0;
                    if (!TaskbarPropertiesManager.Instance.Properties.SmallIcons)
                    {
                        yoffset = 1;
                    }
                    else if (form.Height < this.Height)
                    {
                        if (taskbarLocation == Win32.Native.ABEdge.Bottom)
                        {
                            yoffset = -2;
                        }
                        else
                        {
                            yoffset = 4;
                        }
                    }

                    this._location = new Point(form.Location.X, form.Location.Y + (form.Height - this.Height) / 2 + yoffset);
                }
                else
                {
                    this._location = new Point(form.Location.X + (form.Width - this.Width) / 2, form.Location.Y + 4);
                }
            }
        }
示例#3
0
        public void UpdateAndShow(SecondaryTaskbar form)
        {
            if (Native.IsStartMenuVisible())
            {
                this._state = State.Active;
            }
            else
            {
                this._state = State.Normal;
            }

            this.CalculateSize();

            this.Show();

            this.TopMost = true;

            this.CalculatePosition(form);

            this.Location = this._location;
            this.Draw();
        }