Question

In: Computer Science

NOTE: This is done using Visual Basic. Create an application named You Do It 1. Add...

NOTE: This is done using Visual Basic.

Create an application named You Do It 1. Add a text box, a label, and a button to the form. The button’s Click event procedure should store the contents of the text box in a Double variable named dblCost. It then should display the variable’s contents in the label. Enter the three Option statements above the Public Class clause in the Code Editor window, and then code the procedure. Save the solution and then start and test the application. Close the solution.

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Windows Forms Application in VB is created using Visual Studio 2017 with name "YouDoIt".This application contains a form with name "Form1.vb".Below are the files associated with form1.

1.Form1.vb[Design]

2.Form1.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.txtContents = New System.Windows.Forms.TextBox()
Me.lblContents = New System.Windows.Forms.Label()
Me.btnContents = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'txtContents
'
Me.txtContents.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtContents.Location = New System.Drawing.Point(42, 22)
Me.txtContents.Name = "txtContents"
Me.txtContents.Size = New System.Drawing.Size(169, 26)
Me.txtContents.TabIndex = 0
'
'lblContents
'
Me.lblContents.AutoSize = True
Me.lblContents.Location = New System.Drawing.Point(111, 121)
Me.lblContents.Name = "lblContents"
Me.lblContents.Size = New System.Drawing.Size(0, 13)
Me.lblContents.TabIndex = 1
'
'btnContents
'
Me.btnContents.Location = New System.Drawing.Point(72, 66)
Me.btnContents.Name = "btnContents"
Me.btnContents.Size = New System.Drawing.Size(114, 23)
Me.btnContents.TabIndex = 2
Me.btnContents.Text = "&Display Contents"
Me.btnContents.UseVisualStyleBackColor = True
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(275, 167)
Me.Controls.Add(Me.btnContents)
Me.Controls.Add(Me.lblContents)
Me.Controls.Add(Me.txtContents)
Me.Name = "Form1"
Me.Text = "You Do It"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub

Friend WithEvents txtContents As TextBox
Friend WithEvents lblContents As Label
Friend WithEvents btnContents As Button
End Class

3.Form1.vb

'three Option statements
Option Explicit On
Option Strict On
Option Compare Binary
Public Class Form1
Private Sub btnContents_Click(sender As Object, e As EventArgs) Handles btnContents.Click
'declaring variable of type double
Dim dblCost As Double
'taking text entered by user and assign to the variable dblCost
dblCost = Double.Parse(txtContents.Text)
'display variable’s contents in the label
lblContents.Text = dblCost.ToString()
End Sub
End Class

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :

Screen 2:Enter contents and click on button to get the contents on the label

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

NOTE: This is done using Visual Basic. Create an application named You Do It 2. Add...
NOTE: This is done using Visual Basic. Create an application named You Do It 2. Add a text box, a label, and a button to the form. Enter the following three Option statements above the Public Class clause in the Code Editor window: Option Explicit On, Option Strict Off, and Option Infer Off. In the button’s Click event procedure, declare a Double variable named dblNum. Use an assignment statement to assign the contents of the text box to the Double...
windows forms Application using Visual Basic use visual basic 2012 Part 1: Programming – Income Tax...
windows forms Application using Visual Basic use visual basic 2012 Part 1: Programming – Income Tax Application 1.1 Problem Statement Due to upcoming end of financial year, you are being called in to write a program which will read in a file and produce reports as outlined. Inputs: The input file called IncomeRecord.txt contains a list of Annual income records of employees in a firm. Each record is on a single line and the fields are separated by spaces. The...
Program on Visual Basic, VBA Create an application that lets the user enter a number of...
Program on Visual Basic, VBA Create an application that lets the user enter a number of seconds and produces output according to the following criteria: There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or...
Windows Forms application using Visual Basic: Create a class called Character that a role-playing game might...
Windows Forms application using Visual Basic: Create a class called Character that a role-playing game might use to represent a character within the game. A character should include six stats as instance variables – strength, dexterity, constitution, intelligence, wisdom and charisma (all types are int). Your class should have a constructor that initializes these six instance variables. Provide Properties with an appropriate set and get block for each instance variable. In addition, provide a method named getStatsTotal that calculates the...
Visual Basic Your first job is to create a visual basic project that will display the...
Visual Basic Your first job is to create a visual basic project that will display the name and telephone number for the contact person for the customer relations, marketing, order processing, and shipping departments. Include a button for each department. When the user clicks on the button for a department the program(in code for specific button will display the name and telephone number for the contact person in two labels. The same two labels will be used for each department...
C# Programming language!!! Using visual studios if possible!! PrimeHealth Suite You will create an application that...
C# Programming language!!! Using visual studios if possible!! PrimeHealth Suite You will create an application that serves as a healthcare billing management system. This application is a multiform project (Chapter 9) with three buttons. The "All Accounts" button allows the user to see all the account information for each patient which is stored in an array of class type objects (Chapter 9, section 9.4).The "Charge Service" button calls the Debit method which charges the selected service to the patient's account...
using visual basic how would i go about coding: if checkbox 1 is checked add 10...
using visual basic how would i go about coding: if checkbox 1 is checked add 10 to subtotal if checkbox 2 is checked add 50 to subtotal if checkbox 3 is checked add 100 to subtotal subtotal label is 'lblSubtotal' all 3 boxes are independent. example if checkboxes 1 and 3 are checked 110 would be added to subtotal.
Must be in Visual C# using windows forms : Create an application that opens a specified...
Must be in Visual C# using windows forms : Create an application that opens a specified text file and then displays a list of all the unique words found in the file. Hint: Use a LINQ method to remove all duplicate words.
Create an empty Web Site application named Bakery. Add a new Web page named Default.aspx to the application. Change the DOCUMENT object's Title property to Meyer's.
In Visual BasicCreate an empty Web Site application named Bakery. Add a new Web page named Default.aspx to the application. Change the DOCUMENT object's Title property to Meyer's. The application should allow the user to enter two items: the number of doughnuts ordered and the number of muffins ordered. The application should should display the total number of items ordered and the total sales amount, inlcuding a 5% sales tax. A doughnut costs .50; a muffin costs .75. Save the...
Make a Console application Language should be Visual Basic In this assignment, you will be calculating...
Make a Console application Language should be Visual Basic In this assignment, you will be calculating the two parts for each month. you calculate the interest to pay each month and principal you pay every month. The interest you pay every month = loan * monthlyInterest The principal you pay every month = monthlyMortgage -  interest you pay every month ' what is my remaining loan loan = loan - principal you pay every month Problem 1 : Using While Loop,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT