Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
there is a trackbar in my windows form application and there is a text box.I should be able to display the value of the trackbar only upon the release of mouse.How do i do it so?

Regards.
Posted

1 solution

Just use the TrackBar's MouseUp event, like this:-

C#
private void trackBar1_MouseUp(object sender, MouseEventArgs e)
        {
            textBox1.Text = trackBar1.Value.ToString();
        }



Hope this helps
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Sep-11 16:24pm    
Correct, a 5.
(A note: naming "trackBar1_MouseUp" violate (good) Microsoft naming requirements. Yes, it was auto-generated by Microsoft, by you're not supposed to use such names; you need to rename them all semantically; also, you need to show where the event handler is added to the event's invocation list ("=+" operation).)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900