Solved

Which Code Example Will Calculate the Number of Checked Items

Question 12

Multiple Choice

Which code example will calculate the number of checked items in a CheckedListBox named clbMovieNames and store the number in intCheckedMovies?


A) Dim intCheckedMovies As Integer = 0 intCheckedMovies = clbMovieNames.Items.Count - 1

B) Dim intIndex As Integer Dim intCheckedMovies As Integer = 0
For intIndex = 0 To clbMovieNames.Items.Count - 1
If clbMovieNames.GetItemChecked(intIndex) = True Then
IntCheckedMovies += 1
End If
Next

C) Dim intIndex As Integer Dim intCheckedMovies As Integer = 0
For intIndex = 0 To clbMovieNames.Items.Count - 1
If clbMovieNames.GetItemChecked(intIndex) = True Then
LstChecked.Items.Add(clbCities.Items(intIndex) )
End If
Next

D) Dim intIndex As Integer Dim intCheckedMovies As Integer = 0
For intIndex= 1 To clbMovieNames.Items.Count
If clbMovieNames.GetItemChecked(intIndex) = True Then
IntCheckedMovies += 1
End If
Next

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents