Esempio n. 1
0
        /// <summary>
        /// Event delegate method fired when the <see cref="AddButton"/> button is clicked.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Event arguments.</param>
        private void AddButton_Click(object sender, EventArgs e)
        {
            Point screenPoint = AddButton.PointToScreen(new Point(AddButton.Left, AddButton.Bottom));

            AddButtonContextMenuStrip.Show(AddButton,
                                           screenPoint.Y + AddButtonContextMenuStrip.Size.Height > Screen.PrimaryScreen.WorkingArea.Height
          ? new Point(0, -AddButtonContextMenuStrip.Size.Height)
          : new Point(0, AddButton.Height));
        }