private void Listbox_BeforeDrawItem(object sender, ListBox.ObjectCollection items, DrawItemEventArgs e) { if (Items.Count != LastCount) { listbox.SetScrollInfo(); LastCount = Items.Count; ItemsCountChange?.Invoke(this, null); } }
private void Timer_Tick(object sender, EventArgs e) { if (Items.Count == 0 && LastCount != 0) { LastCount = 0; timer.Stop(); ItemsCountChange?.Invoke(sender, e); timer.Start(); } }