GeorgeSog
GeorgeSog

Reputation: 1

Update trackbar value on mouse wheel

I am using the scroll event but this only update value in label when i click on trackBar and move it right or left. I see that i can move it when i use mouse wheel but this doesn't update value in label just moving it.

private void metroTrackBar1_Scroll(object sender, ScrollEventArgs e)
{
    lblVolume.Text = metroTrackBar1.Value.ToString();
}

So my question is:

How I can make trackBar to update value in label when i scroll with mouse wheel?

Upvotes: 0

Views: 642

Answers (1)

GeorgeSog
GeorgeSog

Reputation: 1

I found solution, used ValueChanged event instead of Scroll event, this works in both cases, when i move trackBar with mouse wheel or when i drag it with mouse.

private void metroTrackBar1_ValueChanged(object sender, EventArgs e)
{
    lblVolume.Text = metroTrackBar1.Value.ToString();
}

Upvotes: 0

Related Questions