Ejemplo n.º 1
0
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            IListControlRenderer renderer       = GetRenderer();
            ImageComboItem       imageComboItem = e.Index >= 0
                ? (Items[e.Index] is ImageComboItem
                    ? (ImageComboItem)Items[e.Index]
                    : new ImageComboItem(Items[e.Index].ToString()))
                : new ImageComboItem(Text);
            var e1 = new ListControlDrawItemEventArgs(e, imageComboItem)
            {
                Image  = GetItemImage(imageComboItem),
                Offset = Padding.Left
            };

            renderer.DrawItemBackground(this, e1);
            renderer.DrawItemImage(this, e1);
            renderer.DrawItemText(this, e1);
        }
Ejemplo n.º 2
0
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            IListControlRenderer renderer       = GetRenderer();
            ImageComboItem       imageComboItem = GetItem(e.Index);
            var e1 = new ListControlDrawItemEventArgs(e, imageComboItem)
            {
                Image  = GetItemImage(imageComboItem),
                Offset = Padding.Left
            };

            if (HoverIndex == e.Index)
            {
                e1.State |= DrawItemState.HotLight;
            }
            renderer.DrawItemBackground(this, e1);
            renderer.DrawItemImage(this, e1);
            renderer.DrawItemText(this, e1);
        }