Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN VISUAL BASIC When the user clicks on the Input Names button, they will be prompted to enter a series of 10 names that are

IN VISUAL BASIC

When the user clicks on the Input Names button, they will be prompted to enter a series of 10 names that are loaded into an array and then displayed in the list box.

You must add a loop to the btnInput Click Event Procedure that loops through the strNames array, calling an Input Box and entering the user supplied value into an array element for each element in the array.

After all of the array elements contain names, the DisplayNames sub is called to display the names in the list box.

Complete the click event procedure, copy, and paste the entire click event procedure into the answer window for this question.

HINTS

Remember that the first subscript value for every array is 0. This means that the maximum subscript value in a 10-element array is 9.

An excellent way to process every element in an array, one at a time, is with a ForNext loop. For example, the following loop will divide each array element by 100 (the array in this case has 20 elements):

Dim intCount as Integer = 0 For intIndex = 0 to 19 decNumbers(intIndex) = decNumbers(intIndex) / 100 Next

-----------------------------------------------------------------------------------------------------------------

An example of an Input Box call that requests the name of a city and assigns it to a variable is:

strCity = InputBox(Enter the name of a city, Input City Name)

Private Sub btnInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput.Click

'Create a loop here that that loops through the strNames array, 'calling an Input Box And entering the user supplied value into 'an Array element for each element in the array.

'After your loop has populated the array with values, 'The DisplayNames sub is called to display the array 'elements in the list box. DisplayNames()

End Sub

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started