예제 #1
0
        public ButtonClient(CommandButton commandButton)
        {
            _commandButton          = commandButton;
            _commandButton.Changed += new CommandControlChangedEventHandler(this.ClientUpdate);
            this.Dock = DockStyle.None;
            Debug.Assert(_commandButton.Icon != null, "CommandButton has null icon: " + _commandButton.GetType());
            _bitmap = new Bitmap(16, 16, PixelFormat.Format32bppArgb);
            BitmapUtils.CopyBitmapData(_commandButton.Icon.ToBitmap(), _bitmap);
            BitmapUtils.SetTransparency(_bitmap, Color.Magenta);
            _bitmapDark       = ExoControlUtils.CreateDisabledBitmap(_bitmap, 192, 64);
            _bitmapUnselected = ExoControlUtils.CreateContrastedBitmap(_bitmap, 0.8f);

            this.Size    = new Size(22, 22);
            this.Layout += new LayoutEventHandler(this.OnLayout);
        }