Question

Posting this again because I was given a completely wrong answer but I appreciate anyone who...

Posting this again because I was given a completely wrong answer but I appreciate anyone who can try to help me with this.

Unzip and open the Turner Solution\Turner Solution.sln file. Set the codeTextBox's MaxLength property to 1. The codeTextBox should accept only the numbers 1, 2, 3, and 4 and the Backspace key; code the appropriate event procedure. Code the displayButton_Click procedure to display the appropriate image in the displayPictureBox. The appropriate image is based on the code entered by the user. Display the house1PictureBox's image when the code is 1, and so on. If the codeTextBox is empty, set the display PictureBox's Image property to the keyword Nothing. Size the form to hide the four picture boxes, and then lock the controls. Save the solution and then start and test the application. Close and submit this week's entire project folder into a single zip file.

I need this code in Visual Basic please I basically need one text box and one button coded. I need Visual Basic code for the text box known above to only accept numbers 1-4 and backspace key press. I then need code for the display button so it displays the image of whatever number is inputted inside of the code text box. Like 1 should show house1PictureBox, 2 should show house2PictureBox, 3 should show house3PictureBox, and 4 should show house4PictureBox, and no input show show nothing. I'll explain what everything is because I unfortunately cannot show it. The application has codeTextBox, displayButton, exitButton(already coded), displayPictureBox, house1PictureBox, house2PictureBox, house3PictureBox, and house4PictureBox. Again I really need this in Visual Basic here's the code already given to me. I really would appreciate it if an expert can help thank you!

Option Explicit On
Option Strict On
Option Infer Off

Public Class MainForm
Private Sub exitButton_Click(sender As Object, e As EventArgs) Handles exitButton.Click
Me.Close()
End Sub
End Class

Homework Answers

Answer #1

Try below coding:

Dim img As Image = Image.FromFile("C:\Users\Pranesh\Pictures\11599264.jpg")
house1PictureBox.Image = img
house2PictureBox.Image = img
house3PictureBox.Image = img
house4PictureBox = img


house1PictureBox.Visible = False
house2PictureBox.Visible = False
house3PictureBox.Visible = False
house4PictureBox.Visible = False

Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
If codeTextBox.Text = "1" Then
house1PictureBox.Visible = True
ElseIf codeTextBox.Text = "2" Then
house2PictureBox.Visible = True
ElseIf codeTextBox.Text = "3" Then
house3PictureBox.Visible = True
ElseIf codeTextBox.Text = "4" Then
house4PictureBox.Visible = True
Else
MessageBox.Show("Invalid number")
End If
End Sub

Result:

Waiting for your comments

Know the answer?
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
Similar Questions
Hello Expert, I am stuck on this assignment and can't get my code to run. I...
Hello Expert, I am stuck on this assignment and can't get my code to run. I would really appreciate it if anyone can help me. Assignment Requirements: Your software development company wants to continue developing and enhancing a software for internal use. For this week's assignment, it is required to read from a JSON application file (data.json) containing employee information. You will not use LINQ for this task. Your tasks include: Convert the previously created data.txt file into a JSON...
For this assignment you'll be creating an application that has the user input a subtotal, tax...
For this assignment you'll be creating an application that has the user input a subtotal, tax rate and tip percentage and then displays the sales tax, tip amount and the total. You'll use JQuery instead of the getElementByX functions AND you will display all messages on the page (no alert or prompt boxes) The starter file is based off of the Lab 2 sales_tax application. Feel free to borrow code from your lab solution but realize you will need to...
This will be my third time submitting this question. THERE SHOULD BE NO USE OF CSS...
This will be my third time submitting this question. THERE SHOULD BE NO USE OF CSS OR SWITCH STATEMENTS IN THE JAVASCRIPT. Even though there is stylesheet in the HTML file do no create a new one. Project Standards: Students will use click events to capture user input. Students will use variables to store information needed by their application and keep track of their program’s state. Students will use conditionals to control project flow. Project Task You will be building...
I am trying to make a program in C# and was wondering how it could be...
I am trying to make a program in C# and was wondering how it could be done based on the given instructions. Here is the code that i have so far... namespace Conversions { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if...
I've posted this question like 3 times now and I can't seem to find someone that...
I've posted this question like 3 times now and I can't seem to find someone that is able to answer it. Please can someone help me code this? Thank you!! Programming Project #4 – Programmer Jones and the Temple of Gloom Part 1 The stack data structure plays a pivotal role in the design of computer games. Any algorithm that requires the user to retrace their steps is a perfect candidate for using a stack. In this simple game you...
Can someone please edit my code so that it satisfies the assignments' requirements? I pasted the...
Can someone please edit my code so that it satisfies the assignments' requirements? I pasted the codes below. Requirement: Goals for This Project:  Using class to model Abstract Data Type  OOP-Data Encapsulation You are asked to write an app to keep track of a relatively small music library. The app should load song information from a data file once the app is started. It should allow user to view, add, remove, and search for songs. The app should...
Challenge 5 Read ALL of the instructions carefully before starting the exercise! Dear Colleague, Earlier today...
Challenge 5 Read ALL of the instructions carefully before starting the exercise! Dear Colleague, Earlier today I built my fourth website using HTML5 and CSS3. This time I wanted to try using CSS float layout options on a website dedicated to my favorite topic: robotics. I wanted my website to look like what is shown in Figure 1 (see below). However, after giving it my best effort, things once again didn’t turn out the way I wanted (see the code...
Plagiarism Certification Tests for Undergraduate College Students and Advanced High School Students These tests are intended...
Plagiarism Certification Tests for Undergraduate College Students and Advanced High School Students These tests are intended for undergraduate students in college or those under 18 years of age. Read these directions carefully! The below test includes 10 questions, randomly selected from a large inventory. Most questions will be different each time you take the test, You must answer at least 9 out of 10 questions correctly to receive your Certificate. You have 40 minutes to complete each test, and you...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Compile and execute the application. You will discover that is has a bug in it -...
Compile and execute the application. You will discover that is has a bug in it - the filled checkbox has no effect - filled shapes are not drawn. Your first task is to debug the starter application so that it correctly draws filled shapes. The bug can be corrected with three characters at one location in the code. Java 2D introduces many new capabilities for creating unique and impressive graphics. We’ll add a small subset of these features to the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT