Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7495227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:00:11+00:00 2026-05-29T18:00:11+00:00

Is there an event fired when a ListBox begins to scroll? I currently have

  • 0

Is there an event fired when a ListBox begins to scroll?

I currently have the following code to allow for a seamless drag and dropping from a listbox.

<ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" Margin="-5"  />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate >
                    <DataTemplate>

                        <Image  ManipulationStarted="ListImage_ManipulationStarted" Tag="{Binding selfReference}"   x:Name="ListImage" Margin="2.5" Stretch="Fill" Source="{Binding thumbnailURL}" Height="64" Width="64"/>

                    </DataTemplate>
                </ListBox.ItemTemplate>

            </ListBox>

And then in the code

private void ListImage_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
        {
            if (dImage == null)
            {
                SoundEffectModel selectedModel = (sender as Image).Tag as SoundEffectModel;
                int newIndex = listBoxSource.Items.IndexOf(selectedModel);
                if (newIndex != -1)
                {
                    listBoxSource.SelectedIndex = newIndex;
                }
            }
        }

I then duplicate the selected item in the listbox, and place it directly over the current location of the selected item. All works well.

However, if the user begins to scroll the listBox instead of draging the item around the application, the duplicated image sits ontop of the listBox and it looks unprofessional. As soon as the user lifts their finger, the duplicated item is deleted, because I can detect the manipulationComplete event, and realize that the item is in the “wrong place”.

Is there a way for me to delete the item when the scrolling begins instead of waiting for the manipulationComplete event?


Related questions for context:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:00:12+00:00Added an answer on May 29, 2026 at 6:00 pm

    No, there is not an event fired when the ListBox scrolls, however, you can locate the ScrollViewer which is within the ListBox template and handle the ValueChanged event which occurs as soon as scrolling starts.

    You can locate the scrollbar as follows:

    /// <summary>
    /// Searches the descendants of the given element, looking for a scrollbar
    /// with the given orientation.
    /// </summary>
    private static ScrollBar GetScrollBar(FrameworkElement fe, Orientation orientation)
    {
      return fe.Descendants()
                .OfType<ScrollBar>()
                .Where(s => s.Orientation == orientation)
                .SingleOrDefault();
    
    }
    

    This uses Linq to Visual Tree, as described in this blog post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to access the DOM from the event fired by DOMContentLoaded
Is there an event that is fired when the user presses the close button?
Is there an event in WinForms that get's fired when a window is dragged?
Is there an event fired when screensaver starts? Like for keychain locking: OSStatus keychain_locked(SecKeychainEvent
Is there an event that is fired when you maximize a Form or un-maximize
Is there an event that gets fired when one clicks the ColumnHeader of a
Is there some JavaScript event fired when user enables full screen in Chrome or
Is there an event that is fired prior to an action method being called
Having some pain with this event, I have some code like this for a
Is there an event that gets fired after my custom services are created but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.