示例#1
0
 public override void UpdateControl(Rectangle bounds)
 {
     bounds.X--;
     bounds.Y++;
     bounds.Height--;
     if (this.dropList != null)
     {
         Point location = bounds.Location;
         this.dropList.Location = location;
         Size size = bounds.Size;
         this.dropList.Size = size;
     }
     else
     {
         this.dropList = new DropList();
         Point location2 = bounds.Location;
         this.dropList.Location = location2;
         Size size2 = bounds.Size;
         this.dropList.Size     = size2;
         this.dropList.TabIndex = 1;
         this.GetItems();
         if (this.IsDefault())
         {
             this.dropList.Font = new Font(this.dropList.Font, FontStyle.Regular);
         }
         else
         {
             this.dropList.Font = new Font(this.dropList.Font, FontStyle.Bold);
         }
         this.Host.Controls.Add(this.dropList);
         this.dropList.Enter      += new EventHandler(this.dropList_Enter);
         this.dropList.ChooseItem += new DropList.__Delegate_ChooseItem(this.dropList_ChooseItem);
         this.dropList.MouseDown  += new MouseEventHandler(this.dropList_MouseDown);
     }
 }
示例#2
0
        public override bool OnEnterPressed()
        {
            DropList dropList = this.dropList;

            if (dropList != null)
            {
                dropList.Focus();
            }
            this.Host.InvalidateViewControl();
            return(true);
        }
示例#3
0
 public override void DestroyControl()
 {
     if (this.dropList != null)
     {
         this.dropList.Enter      -= new EventHandler(this.dropList_Enter);
         this.dropList.ChooseItem -= new DropList.__Delegate_ChooseItem(this.dropList_ChooseItem);
         this.dropList.MouseDown  -= new MouseEventHandler(this.dropList_MouseDown);
         this.Host.Controls.Remove(this.dropList);
         this.dropList = null;
     }
 }