diff --git a/Rs.Controls/RsTray.cs b/Rs.Controls/RsTray.cs index d864708..a9233bb 100644 --- a/Rs.Controls/RsTray.cs +++ b/Rs.Controls/RsTray.cs @@ -28,7 +28,8 @@ namespace Rs.Controls NotHave, Ok, Ng, - Disable + Disable, + Null } public partial class RsTray : UserControl @@ -271,6 +272,14 @@ namespace Rs.Controls } } + public void ChangeStatus(ESlotStatus status) + { + foreach (KeyValuePair kv in traySlotsDic) + { + ChangeStatus(kv.Value.Index,status); + } + } + public void ChangeStatus(int index, ESlotStatus status) { if (traySlotsDic.ContainsKey(index)) @@ -534,13 +543,23 @@ namespace Rs.Controls case ESlotStatus.Disable: g.FillRectangle(new SolidBrush(Color.Gray), Bound.X, Bound.Y, Bound.Width - 1, Bound.Height - 1); break; + case ESlotStatus.Null: + g.FillRectangle(new SolidBrush(Color.FromArgb(11, 16, 36)), Bound.X, Bound.Y, Bound.Width - 1, Bound.Height - 1); + break; default: break; } - g.DrawRectangle(Pens.White, Bound.X, Bound.Y, Bound.Width, Bound.Height); - if (isShowText) + if(SlotStatus!= ESlotStatus.Null) + { + g.DrawRectangle(Pens.White, Bound.X, Bound.Y, Bound.Width, Bound.Height); + if (isShowText) + { + g.DrawString(Index.ToString(), new Font("宋体", 8), new SolidBrush(Color.Yellow), _Bound, sf); + } + } + else { - g.DrawString(Index.ToString(), new Font("宋体", 8), new SolidBrush(Color.Yellow), _Bound, sf); + g.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(11, 16, 36))), Bound.X, Bound.Y, Bound.Width, Bound.Height); } } }