Example #1
0
        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler                                                              //
        ///////////////////////////////////////////////////////////////////////////////
        #region EVENTS

        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler for UI, Menu, Buttons, Toolbars etc.                         //
        ///////////////////////////////////////////////////////////////////////////////
        #region WINDOWSEVENTHANDLER

        /// <summary>
        /// OnClick event handler. Shows color selection panel of type <see cref="ColorPanel"/>.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">An empty <see cref="EventArgs"/></param>
        private void ColorButton_Click(object sender, EventArgs e)
        {
            ColorPanel clrPanel = new ColorPanel(base.Parent.PointToScreen(new Point(base.Left, base.Bottom)),
                                                 this, _color);

            clrPanel.Automatic = this.autoButtonString;
            clrPanel.Show();
        }
Example #2
0
 /// <summary>
 /// On mouse down event handler. Shows color selection panel of type <see cref="ColorPanel"/>.
 /// </summary>
 /// <param name="e">A <see cref="MouseEventArgs"/> that contains the event data.</param>
 protected override void OnMouseDown(MouseEventArgs e)
 {
   //Instatiate Color panel
   ColorPanel clrPanel = new ColorPanel(base.Parent.PointToScreen(new Point(base.Bounds.Left, base.Bounds.Bottom)),
     this, _color);
   //Show dialog
   if (clrPanel.ShowDialog() == DialogResult.OK)
   {
     ////Set property.
     //this.Color = this._color;
     //Raise event.
     OnColorChanged(EventArgs.Empty);
   }
 }
        /// <summary>
        /// On mouse down event handler. Shows color selection panel of type <see cref="ColorPanel"/>.
        /// </summary>
        /// <param name="e">A <see cref="MouseEventArgs"/> that contains the event data.</param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            //Instatiate Color panel
            ColorPanel clrPanel = new ColorPanel(base.Parent.PointToScreen(new Point(base.Bounds.Left, base.Bounds.Bottom)),
                                                 this, _color);

            //Show dialog
            if (clrPanel.ShowDialog() == DialogResult.OK)
            {
                ////Set property.
                //this.Color = this._color;
                //Raise event.
                OnColorChanged(EventArgs.Empty);
            }
        }
Example #4
0
    ///////////////////////////////////////////////////////////////////////////////
    // Eventhandler                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    #region EVENTS

    ///////////////////////////////////////////////////////////////////////////////
    // Eventhandler for UI, Menu, Buttons, Toolbars etc.                         //
    ///////////////////////////////////////////////////////////////////////////////
    #region WINDOWSEVENTHANDLER

    /// <summary>
    /// OnClick event handler. Shows color selection panel of type <see cref="ColorPanel"/>.
    /// </summary>
    /// <param name="sender">Source of the event.</param>
    /// <param name="e">An empty <see cref="EventArgs"/></param>
    private void ColorButton_Click(object sender, EventArgs e)
    {
      ColorPanel clrPanel = new ColorPanel(base.Parent.PointToScreen(new Point(base.Left, base.Bottom)),
  this, _color);
      clrPanel.Automatic = this.autoButtonString;
      clrPanel.Show();
    }