Ultime notizie
Home » Archivio per il tag: ListBox

Archivio per il tag: ListBox

Visual C# (sharp): Listbox: scroll automatico durante il drag

private void ItemsList_DragOver(object sender, System.Windows.DragEventArgs e) { ListBox li = sender as ListBox; ScrollViewer sv = FindVisualChild<ScrollViewer>(ItemsList); double tolerance = 10; double verticalPos = e.GetPosition(li).Y; double offset = 3; if (verticalPos < tolerance) // Top of visible list? { sv.ScrollToVerticalOffset(sv.VerticalOffset ‐ offset); //Scroll up. } else if (verticalPos > li.ActualHeight ‐ tolerance) //Bottom of visible list? { sv.ScrollToVerticalOffset(sv.VerticalOffset + offset); …

Continua a leggere »