protected override void OnDrawItem(DrawItemEventArgs e)
 {
     e.DrawBackground();
     if (e.Index >= 0)
     {
         ImageID iid = this.Items[e.Index] as ImageID;
         e.Graphics.DrawImage(iid.SelectedImage, e.Bounds);
         if ((e.State & DrawItemState.Selected) != 0)
         {
             e.DrawFocusRectangle();
         }
     }
 }
        // Draws a representation of the property's value.
        public override void PaintValue(System.Drawing.Design.PaintValueEventArgs e)
        {
            ImageID imgid = (ImageID)e.Value;

            if (imgid.SelectedImage != null)
            {
                e.Graphics.DrawImage(imgid.SelectedImage, e.Bounds);
            }
            else
            {
                Font ft = new Font("Times New Roman", e.Bounds.Height, GraphicsUnit.Pixel);
                e.Graphics.DrawString(imgid.ID.ToString(), ft, Brushes.Black, (float)0, (float)0);
            }
        }