Private Function isValidate(ByRef aTextBox As TextBox) As Boolean Dim bResult As
ID: 3629931 • Letter: P
Question
Private Function isValidate(ByRef aTextBox As TextBox) As BooleanDim bResult As Boolean
'check all scores entered by the user to make sure that each score is a valid integer from 0 to 100.
Return bResult
End Function
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
'check if the user select any item
'call isvalidate function to validate the input
'call update
'call refreshListbox
End Sub
Private Sub clearList(ByRef aList As List(Of Decimal))
'clear list
End Sub
Private Sub refreshListbox(ByRef aListbox As ListBox, ByRef aList As List(Of Decimal))
'call clearListBox //// remove this line
'bound to listbox
aListbox.DataSource = Nothing 'What is the purpose of this statement?
aListbox.DataSource = aList 'Do you know any other objects can be used as the datasouce of listbox?
' aListbox.Refresh()
Explanation / Answer
Dim index As Integer = lstScores.SelectedIndex
'removing item at selected index
lstScores.Items.RemoveAt(index)
'inserting new item
lstScores.Items.Insert(index, txtScore.Text)
lblAverage.Text = "Average :" 'resetting label text
txtScore.Focus() 'focusing cursor in text box
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.