Exemple #1
0
        void OutlookBar_Click(object sender, EventArgs e)
        {
            // case to MouseEventArgs so position and mousebutton clicked can be used
            MouseEventArgs mea = e as MouseEventArgs;

            if (mea == null)
            {
                return;
            }

            // only continue if left mouse button was clicked
            if (mea.Button != MouseButtons.Left)
            {
                return;
            }

            int index = (mea.Y - 1) / (buttonBarHeight + 1);

            if (index < 0 || index >= listButtons.Count)
            {
                return;
            }

            OutlookBarButton button = listButtons[index];

            if (button == null || !button.Enabled)
            {
                return;
            }

            // ok, all checks passed so assign the new selected button
            // and raise the event
            SelectedButton = button;

            ButtonClickEventArgs bce = new ButtonClickEventArgs(selectedButtonBar, mea);

            if (Click != null) // only invoke on left mouse click
            {
                Click.Invoke(this, bce);
            }
        }
 public ButtonSelectEventArgs(OutlookBarButton button)
 {
     SelectedButton = button;
 }
Exemple #3
0
 public ButtonClickEventArgs(OutlookBarButton button, MouseEventArgs evt) : base(evt.Button, evt.Clicks, evt.X, evt.Y, evt.Delta)
 {
     SelectedButton = button;
 }
Exemple #4
0
 public int IndexOf(OutlookBarButton value)
 {
     return(List.IndexOf(value));
 }