43.4k views
5 votes
Which of the following statements selects the "blue" item, which appears fourth in the lstColor control?a. lstColor.SlectIndex = 3b. lstColor.SlectIndex = 4d. lstColor.SlectItem = 3e. lstColor.SlectIitem = 4

User Santanu C
by
3.4k points

1 Answer

2 votes

Answer:

a. lstColor.SlectIndex = 3

Step-by-step explanation:

Listbox uses index to represent items.

The index starts its count from 0. Meaning that, the first item has an index of 0, the second has an index of 1 and so on.

From the question, the said color is the 4th in the list; going by the simple analysis stated above, it's index is 4-1 = 3.

The syntax for that is

listboxname.Selectedindex = index

i.e.

lstColor.SelectIndex = 3.

User Andrew Patterson
by
4.7k points