Beispiel #1
0
 /// <summary>
 /// Checks if the Control Contains a command, if it does not it sets the default
 /// </summary>
 /// <param name="button">The control whose command will be checked</param>
 public static void CheckCommand(System.Windows.Forms.ButtonBase button)
 {
     if (button != null)
     {
         if (GetCommand(button).Equals(""))
         {
             SetCommand(button, button.Text);
         }
     }
 }
Beispiel #2
0
        /* ----------------------------------------------------------------- */
        ///
        /// ButtonPainter
        ///
        /// <summary>
        /// オブジェクトを初期化します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public ButtonPainter(System.Windows.Forms.ButtonBase view)
        {
            View    = view;
            Content = view?.GetType().Name;

            View.Paint      += (s, e) => OnPaint(e);
            View.MouseEnter += (s, e) => OnMouseEnter(e);
            View.MouseLeave += (s, e) => OnMouseLeave(e);
            View.MouseDown  += (s, e) => OnMouseDown(e);
            View.MouseUp    += (s, e) => OnMouseUp(e);

            DisableSystemStyles();
        }