Question

In Visual Basic Windows Form App, how would you create an object with 5 fields that...

In Visual Basic Windows Form App, how would you create an object with 5 fields that pulled from text boxes and adds the object to an array of objects at the push of a button. For example an object Item has the fields strManufacturer, strProcessor, strForm, strVideo, and strRAM. How do I send the text someone enters in to those variables and make an object that is in an array of objects with a button called save?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey! Try using this code to store inputs into an array.

1. First, declare an array to store your inputs.

Dim arrays(5) As String

This array with name 'arrays' will store 5 elements of type string.

2. Store your input into a variable

For example for the first field.strManfacturer:

Console.WriteLine("Enter the manufacturer:")

strManufacture =  Console.ReadLine

3. Do the same for other inputs.

4. Store it in an array on clicking save button

Private Sub SaveToArray()
    arrays(0) = strManufacture
     .
     .
    //Similarily for all the inputs//
End Sub

5. Now call this function on button click event handler.

Using something like this:

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
    Call SaveToArray()
End Sub

Hope that solves the problem. Feel free to ask any queries in the comments section.

Keep Chegging. Have a nice day!

:)

Add a comment
Know the answer?
Add Answer to:
In Visual Basic Windows Form App, how would you create an object with 5 fields that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please note: This is in Visual Basic. Create an application (windows forms app). Add a label...

    Please note: This is in Visual Basic. Create an application (windows forms app). Add a label and a button to the form. The button’s Click event procedure should declare and initialize a one-dimensional Double array. Use any six numbers to initialize the array. The procedure should display (in the label) the lowest value stored in the array. Code the procedure using the For...Next statement.

  • Please help! Visual Basic - Windows App Form .NET Framework. ​Option Explicit ON ​Option Strict ON...

    Please help! Visual Basic - Windows App Form .NET Framework. ​Option Explicit ON ​Option Strict ON ​Option Infer ON calculate Letter Grade Number grade: I Letter grade: Calculate Exxt Start a new Project named GradeConverter Add labels, textboxes, and button to the default form. Create an event handler for Calculate and Exit. . When the user enters a number- between 0.0 and 100.0 and clicks Calculate, the letter grade will display for the user The form should be able to...

  • Create a C# program using WINDOWS FORM App in Visual Studio. THE ANSWER MUST BE IN...

    Create a C# program using WINDOWS FORM App in Visual Studio. THE ANSWER MUST BE IN C#, IN WINDOW FORM APP, IN VISUAL STUDIOS. Write the code to: Write a method called MaximumDiffrence that accepts an integer array as a parameter and return the maximum difference between adjacent values in the array, where the gap is defined as the absolute value of the difference between the 2 adjacent values. Example: if the array contains {5, 7, 4, 9, 6, 12,...

  • PLEASE USE VISUAL BASIC* BY VISUAL STUDIO. Visual Basic INTERMEDIATE Create a Windows Forms application. Use...

    PLEASE USE VISUAL BASIC* BY VISUAL STUDIO. Visual Basic INTERMEDIATE Create a Windows Forms application. Use the following names for the project and solution, respectively: Chopkins Project and Chopkins Solution. Save the application in the VB2017\Chap03 folder. Change the form file's name to Main Form.vb. Change the form's name to frmMain. Create the interface shown in Figure 3-37. The interface contains six labels, three text boxes, and two buttons. The application calculates and displays the total number of packs ordered...

  • hi i visual basic windows form app .net how do get started for coding i am...

    hi i visual basic windows form app .net how do get started for coding i am new and have no experience i know the dim statement but i can figure out the rest is there any way to know how? example using if statements and do while loop

  • In Visual Basic. Thank you in advance! Visual Basic File access Create a form that allow...

    In Visual Basic. Thank you in advance! Visual Basic File access Create a form that allow users to enter information (either through text boxes or user input). You decide what you want the users to enter. Use the information entered by the user to create a file that contains the information entered.

  • using Visual Basic>>> Create a form with two text boxes and a checkbox The checkbox should...

    using Visual Basic>>> Create a form with two text boxes and a checkbox The checkbox should say "equals" The checkbox should be checked if the text in the two textboxes are equal and should not be checked if the texts are different. It should work no matter what the user enters into either textbox.

  • 1. Describe how a Windows Store app is displayed differently from a Windows application. 2. Instead...

    1. Describe how a Windows Store app is displayed differently from a Windows application. 2. Instead of icons, Windows Store apps are launched by tapping or clicking _________. 3. What is the file extension of an app package in the Windows Store? 4. What does touch-first mean when using Windows Store apps? 5. How many touch points does a Windows 8 device typically have? 6. Windows Store apps can be written in which programming languages? 7. What does XAML stand...

  • The questions below deal with Microsoft Visual Studio 2012 Reloaded, under the Visual Basic programming language....

    The questions below deal with Microsoft Visual Studio 2012 Reloaded, under the Visual Basic programming language. The book ISBN number that I am using is: 978-1-285-08416-9 or the UPC code is: 2-901285084168-1. Question 1 Visual Basic 2012 is an object-oriented programming language, which is a language that allows the programmer to use ____________________ to accomplish a program�s goal. Question 2 An application that has a Web user interface and runs on a server is called a(n) ____________________ application. Question 3...

  • If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create...

    If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create a Windows application using C# visual studio that functions like a banking account register. The graphical user interface should initially allow the user to input the account name, number, and initial balance. Ensure that the full name is entered for the customer and that only numeric values are entered for number fields when the Create Account button is selected. Separate the business logic from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT