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

  • Home
  • SEARCH
  • 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 3618594
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:46:21+00:00 2026-05-18T22:46:21+00:00

This is probably a n00b query. I have a need where I want to

  • 0

This is probably a n00b query. I have a need where I want to change the trackbar value based on a mouse down event. This I achieved as follows:

private void MoveTrackBarToMouseClickLocation(TrackBar a_tBar, int a_mouseX)
{
    // Jump to the clicked location

        double dblValue;
        dblValue = ((double)a_mouseX / (double)a_tBar.Width) * (a_tBar.Maximum -    a_tBar.Minimum);
        a_tBar.Value = Convert.ToInt32(dblValue);
}

That part works fine. I am having trouble getting the scroll working while the mouse button is pressed. e.g. If I click on the trackbar and it takes me to say value 50 with the mouse down, I want to be able to scroll right or left (from value=50) while that mouse is down.

I hope I have made my small issue clear.
Any help is appreciated.
Thanks

  • 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-18T22:46:22+00:00Added an answer on May 18, 2026 at 10:46 pm

    You need to execute your code in the MouseMove event, as well as the MouseDown event.

    This event occurs when the mouse is moved while one of the buttons is held down. In contrast, the MouseDown event that you currently handle only gets raised once each time the mouse button is pressed down. That’s why the TrackBar is not moving when the user moves the mouse, but is working properly the first time the button is pressed.

    You didn’t show the code where you wired up the event handlers and/or call the MoveTrackBarToMouseClickLocation function, so that’s as specific as I can get. But if you managed to wire up the MouseDown event already, this should be a simple fix.

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

Sidebar

Related Questions

This is probably a n00b question, but nontheless... I have a bit of a
this is probably a n00b question, but I don't really have any experience in
I'm a bit of a n00b with jquery so this one is probably an
This probably has a simple answer, but I must not have had enough coffee
This probably sounds really stupid but I have noo idea how to implement jquery's
Im sorry for this probably dumm question, but I want to simply open modals
This probably sounds like a silly question to seasoned Rails developer. Do I need
this is probably a n00b question, but even so... Apart from MS Office, I
I have a feeling that this probably is not possible using strictly CSS, but,
This probably isn't the most common filename parsing problem, but I have a program

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.