private void OnShiftItem(object sender, ItemInfoEventArgs customEventArgs) { if (customEventArgs.ItemIndex % 2 == 1) { customEventArgs.ItemOffset = Offset; } }
protected internal void RaiseShiftItem(ItemInfoEventArgs ea) { EventHandler <ItemInfoEventArgs> handler = ShiftItem; if (handler != null) { handler(this, ea); } }
protected internal void RaiseOnCreateItemInfo(ItemInfoEventArgs ea) { EventHandler <ItemInfoEventArgs> handler = OnCreateItemInfo; if (handler != null) { handler(this, ea); } }
protected override ItemInfo CreateItemInfo(Rectangle bounds, object item, string text, int index) { ItemInfoEventArgs e = new ItemInfoEventArgs(index, bounds, item); ListBox.RaiseOnCreateItemInfo(e); ItemInfo itemInfo = base.CreateItemInfo(e.ItemBounds, item, text, index); itemInfo.Bounds = bounds; return(itemInfo); }
protected override ItemInfo CreateItemInfo(Rectangle bounds, object item, string text, int index) { ItemInfoEventArgs e = new ItemInfoEventArgs(index, item); ListBox.RaiseShiftItem(e); Rectangle itemBounds = new Rectangle(bounds.X + e.ItemOffset, bounds.Y, bounds.Width, bounds.Height); ItemInfo itemInfo = base.CreateItemInfo(itemBounds, item, text, index); itemInfo.Bounds = bounds; return(itemInfo); }