Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help me fix my visual basic code so it meets the requirements below? THE CODE Public Class FrmContactForm Private Sub Label1_Click(sender As Object,

can someone help me fix my visual basic code so it meets the requirements below?

THE CODE

Public Class FrmContactForm Private Sub Label1_Click(sender As Object, e As EventArgs) Handles LblCityStateZip.Click

End Sub

Private Sub MaskedTextBox1_MaskInputRejected(sender As Object, e As MaskInputRejectedEventArgs) Handles mtbPhoneNumber.MaskInputRejected mtbPhoneNumber.Text = "" End Sub

Private Sub FrmContactForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.BackColor = Color.LavenderBlush End Sub

Private Sub btncontact_Click(sender As Object, e As EventArgs) Handles btncontact.Click

Dim John Smith As String John Smith= txtName.Text

Dim todaydate, futuredate As Date todaydate = Today().ToString("D") futuredate = todaydate.AddDays(3)

Dim addressinfo As String addressinfo = txtAddress.Text

Dim postal As String postal = txtCityStateZip.Text

Dim phone As String phone = mtbPhoneNumber.Text

Dim mailto As String mailto = txtEmailAddress.Text Dim btncontact As String

Dim fullname, lastname As String Dim n As Integer

fullname = txtName.Text n = fullname.IndexOf("")

btncontact = InputBox("Plese enter what you need more encouragement on. Salvation, Worry, Integrity, Discipleship")

LstInfo.Items.Add("John Smith will be happy to assist you with " & btncontact) LstInfo.Items.Add("You should hear something from us by " & futuredate)

LstInfo.Items.Add("You address on file is") LstInfo.Items.Add("" & vbTab & addressinfo) LstInfo.Items.Add("" & vbTab & postal) LstInfo.Items.Add("Your email address on file is " & mailto) LstInfo.Items.Add("Your reference number is " & lastname) LstInfo.Items.Add("_________________")

LstInfo.Items.Add("If you have any questions, feel to contact us at (434)-509-6544")

LstInfo.Items.Add("For God so loved the world he gave his only begotten son, ") LstInfo.Items.Add("whoever believeth in him shall not perish but have everlasting life.") LstInfo.Items.Add("John 3:16")

End Sub

Private Sub btnclose_Click(sender As Object, e As EventArgs) Handles btnclose.Click Me.Close() End Sub

Private Sub btnclear_Click(sender As Object, e As EventArgs) Handles btnclear.Click LstInfo.Items.Clear() txtAddress.Text = "" txtCityStateZip.Text = "" txtEmailAddress.Text = "" txtName.Text = ""

End Sub

Private Sub LstInfo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LstInfo.SelectedIndexChanged

End Sub End Class

INSTRUCTIONS

Your form should be created to look like the below but you can modify the form as long as you meet the following qualifications.

Create three buttons on the form. Name the buttons on the form btnContact, btnClose, and btnClear .

Create access keys for the buttons.

Create a text box and corresponding label for name, address, citystatezip, and email address. These should follow naming conventions using txt and lbl.

Create a checkbox for the user to check if would prefer to be contacted by email.

Create a masked text box for phone number which includes the area code. Use the appropriate naming convention mtb.

Create a Group box to store the Encouragment needed. Use the appropriate naming convention grp.

Create four radio buttons to store the four types of encouragement in the group (Worry, Salvation, Integrity, Dicipliship). Use the appropriate naming convention rad.

Create a listbox to display the information. Use the appropriate naming convention lst.

The tab order should go from top down to do the buttons but the user should not be directed the listbox.

All information in the listbox should be visible and the user should not have to scroll.

On the form load the backcolor of the form changes to a color of your choice.

The following will happen when the contact button is pressed

The listbox will be cleared

The application will call a sub to do error checking on all the text boxes and radio buttons. All text boxes must have an entry and one radio button must be selected. If one of the items is not complete the program will message the user with the error using a message box and direct the user to the appropriate text box using the .focus(). The program will not continue processing if there is an error.

Once it is determined there are no errors the program will store all the user input in variables.

Based on the value selected for encouragment it should be determined who will be the best point of contact using a case statement. The application will also store the verse (feel free to use the verse chosen in week 1) to present based on the encouragement needed. The following people will be contacted based on the entry:

Worry Jeremy

Salvation Sam

Integrity Jackie

Dicipliship Sally

The application will set the preferred contact method based on if the Contact by email is checked

The application will display the Person who will contact the user along with either the email address or phone and the encouragement needed. All three of these will be determined by the application based on what the user has entered.

The day of the week must be determined using a function. The contact date will be the date 3 days from the date the application is running.

The reference number must be determined in a function. Display the reference number for the user that was determined by the first two letters of the last name all upper case and the last four of the phone number

Where you see YOUR NUMBER please use your information.

Display the appropriate Bible verse based on the encouragement needed.

The list box must display all the information below and must use variables where appropriate.

The clear button clears the listbox, radio buttons, checkbox, and all of the textboxes.

The close button closes the application

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

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions