Esempio n. 1
0
        private void c_Leave(object sender, EventArgs e)
        {
            Control c = (Control)sender;
            EXListViewSubItemBase item = (EXListViewSubItemBase)(_clickedsubitem);

            if (item != null)
            {
                item.Text = c.Text;
            }
            else
            {
                _clickedsubitem.Text = c.Text;
            }
            c.Visible        = false;
            _clickeditem.Tag = null;
        }
Esempio n. 2
0
        private void this_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
        {
            e.DrawBackground();
            if (e.ColumnIndex == _sortcol)
            {
                e.Graphics.FillRectangle(_sortcolbrush, e.Bounds);
            }
            if ((e.ItemState & ListViewItemStates.Selected) != 0)
            {
                e.Graphics.FillRectangle(_highlightbrush, e.Bounds);
            }
            int fonty = e.Bounds.Y + ((int)(e.Bounds.Height / 2)) - ((int)(e.SubItem.Font.Height / 2));
            int x     = e.Bounds.X + 2;

            if (e.ColumnIndex == 0)
            {
                EXListViewItem item = (EXListViewItem)e.Item;
                if (item.GetType() == typeof(EXImageListViewItem))
                {
                    EXImageListViewItem imageitem = (EXImageListViewItem)item;
                    if (imageitem.ItemImage != null)
                    {
                        Image img  = imageitem.ItemImage;
                        int   imgy = e.Bounds.Y + ((int)(e.Bounds.Height / 2)) - ((int)(img.Height / 2));
                        e.Graphics.DrawImage(img, x, imgy, img.Width, img.Height);
                        x += img.Width + 2;
                    }
                }
                e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font, new SolidBrush(e.SubItem.ForeColor), x, fonty);
                return;
            }
            EXListViewSubItemBase subitem = e.SubItem as EXListViewSubItemBase;

            if (subitem == null)
            {
                e.DrawDefault = true;
            }
            else
            {
                x = subitem.DoDraw(e, x, this.Columns[e.ColumnIndex] as EXColumnHeader);
                e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font, new SolidBrush(e.SubItem.ForeColor), x, fonty);
            }
        }
Esempio n. 3
0
 public void AddSubItem(EXListViewSubItemBase item)
 {
     m_SubItemList.Add(item);
     base.SubItems.Add(item);
 }