Я хочу использовать TrackBar в своем проекте Visual Studio. Моя цель состоит в том, чтобы пользователь прокручивал индикатор TrackBar, и в зависимости от того, в каком диапазоне значений он находится, он изменит текст метки.
Вот пример того, как я пытался это сделать:
Private Sub ScrollBarProgress() Handles MyBase.Load
If SelfEvaluationReportBAR.Value = (0) Then
FeelingLBL.Text = "Please select a value."
End If
If SelfEvaluationReportBAR.Value = (1, 25) Then
FeelingLBL.Text = "I am starting to develop my ability to perform this task."
End If
If SelfEvaluationReportBAR.Value = (26, 50) Then
FeelingLBL.Text = "I feel improvement in my ability to perform this task."
End If
If SelfEvaluationReportBAR.Value = (51, 75) Then
FeelingLBL.Text = "My confidence in my ability to perform this task is substantial."
End If
If SelfEvaluationReportBAR.Value = (76, 100) Then
FeelingLBL.Text = "I feel fully confident in my ability to efficiently and accurately perform the day to day tasks that are assigned to me."
End If
End Sub
Проблема в том, что всякий раз, когда я пытался установить диапазон, он выдает следующую ошибку:
Ошибка BC30452 Оператор «=» не определен для типов «Целое число» и «(Целое число, Целое число)».
Я думаю, что у меня неправильное форматирование. У кого-нибудь есть идеи о том, как диапазон может/должен быть отформатирован?
Вот мои текущие настройки для TrackBar:
Private Sub SelfEvaluationReportBAR_Scroll(sender As Object, e As EventArgs) Handles MyBase.Load
SelfEvaluationReportBAR.Minimum = 0
SelfEvaluationReportBAR.Maximum = 100
SelfEvaluationReportBAR.SmallChange = 1
SelfEvaluationReportBAR.LargeChange = 5
SelfEvaluationReportBAR.TickFrequency = 5
End Sub
End Class