using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
namespace wsControls
{
[ToolboxItem(true), ToolboxBitmap(typeof(System.Windows.Forms.Panel))]
public class wsRoundButton:Panel
{
wsRoundButtonStatus status = wsRoundButtonStatus.NONE;
public wsRoundButtonStatus wsRoundButtonStatus
{
get { return status; }
set
{
status = value;
switch (status)
{
case wsControls.wsRoundButtonStatus.NONE:
BackgroundImage = null;
break;
case wsControls.wsRoundButtonStatus.CYCLE:
BackgroundImage = (Image)Properties.Resources.Cycle;
break;
case wsControls.wsRoundButtonStatus.ERROR:
BackgroundImage = (Image)Properties.Resources.Error;
break;
case wsControls.wsRoundButtonStatus.GREEN:
BackgroundImage = (Image)Properties.Resources.Green;
break;
case wsControls.wsRoundButtonStatus.OK_BLUE:
BackgroundImage = (Image)Properties.Resources.BlueOk;
break;
case wsControls.wsRoundButtonStatus.OK_GREEN:
BackgroundImage = (Image)Properties.Resources.GreenOk;
break;
case wsControls.wsRoundButtonStatus.QUESTION:
BackgroundImage = (Image)Properties.Resources.Question;
break;
case wsControls.wsRoundButtonStatus.RED:
BackgroundImage = (Image)Properties.Resources.Red;
break;
case wsControls.wsRoundButtonStatus.SUPRIZE:
BackgroundImage = (Image)Properties.Resources.Suprize;
break;
}
}
}
public wsRoundButton()
{
this.Size = new Size(32, 32);
BackgroundImageLayout = ImageLayout.Zoom;
}
}
public enum wsRoundButtonStatus { OK_BLUE, OK_GREEN, ERROR, GREEN, CYCLE, QUESTION, RED, SUPRIZE, NONE }
}