This is probably the n00b request. I have a need when I want to change the value of a trackbar based on a mouse event. I did this as follows:
private void MoveTrackBarToMouseClickLocation(TrackBar a_tBar, int a_mouseX)
{
double dblValue;
dblValue = ((double)a_mouseX / (double)a_tBar.Width) * (a_tBar.Maximum - a_tBar.Minimum);
a_tBar.Value = Convert.ToInt32(dblValue);
}
This part works great. I am having problems with the scroll operation when I click the mouse. for example, If I click on the track panel and I need to say the value 50 with the mouse, I want to be able to scroll left or right (from the value = 50) while this mouse is not working.
Hope I clarified my little problem. Any help is appreciated. Thanks
source
share