/// <summary> /// Raises the ColumnsCollectionSorted event /// </summary> public void OnColumnsCollectionSorted() { ManagedListViewPanel1.buffered_columnsSize = ManagedListViewPanel1.CalculateColumnsSize(); ManagedListViewPanel1_RefreshScrollBars(this, null); ManagedListViewPanel1.Invalidate(); FixWheelScrollSpeed(); if (ColumnsCollectionSorted != null) { ColumnsCollectionSorted(this, new EventArgs()); } }
/// <summary> /// Raises the ItemsCollectionCleared event /// </summary> public void OnItemsCollectionCleared() { ManagedListViewPanel1.buffered_itemsSize = ManagedListViewPanel1.CalculateItemsSize(); ManagedListViewPanel1_RefreshScrollBars(this, null); ManagedListViewPanel1.Invalidate(); FixWheelScrollSpeed(); if (ItemsCollectionCleared != null) { ItemsCollectionCleared(this, new EventArgs()); } }
private void ManagedListViewPanel1_ClearScrolls(object sender, EventArgs e) { hScrollBar1.Maximum = 1; ManagedListViewPanel1.HscrollOffset = hScrollBar1.Value = 0; panel1.Visible = false; vScrollBar1.Maximum = 1; ManagedListViewPanel1.VscrollOffset = vScrollBar1.Value = 0; vScrollBar1.Visible = false; ManagedListViewPanel1.Invalidate(); }
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e) { ManagedListViewPanel1.VscrollOffset = vScrollBar1.Value; ManagedListViewPanel1.Invalidate(); }
private void ManagedListView_Paint(object sender, PaintEventArgs e) { ManagedListViewPanel1.Invalidate(); UpdateScrollBars(); }
/// <summary> /// Update the scroll bars and make the right calculations. Sometime, the control forget to calculate these values and results /// hidden items. /// </summary> public void UpdateScrollBars() { if (ManagedListViewPanel1.viewMode == ManagedListViewViewMode.Details) { int size = ManagedListViewPanel1.buffered_columnsSize; if (size < this.Width) { hScrollBar1.Maximum = 1; ManagedListViewPanel1.HscrollOffset = hScrollBar1.Value = 0; ManagedListViewPanel1.Invalidate(); panel1.Visible = false; } else { hScrollBar1.Maximum = size - ManagedListViewPanel1.Width + 20; panel1.Visible = true; panel1.Enabled = true; } size = ManagedListViewPanel1.buffered_itemsSize; if (size < this.Height) { vScrollBar1.Maximum = 1; ManagedListViewPanel1.VscrollOffset = vScrollBar1.Value = 0; ManagedListViewPanel1.Invalidate(); panel2.Visible = vScrollBar1.Visible = false; } else { vScrollBar1.Maximum = size - ManagedListViewPanel1.Height + 40; panel2.Visible = vScrollBar1.Visible = true; vScrollBar1.Enabled = true; } } else// Thumbnails { Size size = ManagedListViewPanel1.CalculateSizeOfItemsAsThumbnails(); if (size.Height < this.Height) { vScrollBar1.Maximum = 1; ManagedListViewPanel1.VscrollOffset = vScrollBar1.Value = 0; ManagedListViewPanel1.Invalidate(); panel2.Visible = vScrollBar1.Visible = false; vScrollBar1.Enabled = true; } else { vScrollBar1.Maximum = size.Height - ManagedListViewPanel1.Height + 40; panel2.Visible = vScrollBar1.Visible = true; } if (size.Width < this.Width) { hScrollBar1.Maximum = 1; ManagedListViewPanel1.HscrollOffset = hScrollBar1.Value = 0; ManagedListViewPanel1.Invalidate(); panel1.Visible = false; } else { hScrollBar1.Maximum = size.Width - ManagedListViewPanel1.Width + 20; panel1.Visible = true; panel1.Enabled = true; } } HideTooltip(); }