Question

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.

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

Public Class Form1
Dim form2 As New Form
Dim txtBox1 As New TextBox
Dim txtBox2 As New TextBox
Dim checkbox1 As New CheckBox
Sub check()
If ((txtBox1.Text).Equals(txtBox2.Text)) Then
checkbox1.Checked = True
Else
checkbox1.Checked = False
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Minimized 'hiding form1 at runtime
Me.ShowInTaskbar = False 'hiding form1 at runtime while showing user created form

'creation of form2 at runtime
form2.Size = New System.Drawing.Size(500, 500)
form2.Text = "FormDemo"
form2.Show()

'creation of txtBox1 at runtime
txtBox1.Location = New System.Drawing.Point(60, 25)
txtBox1.Size = New System.Drawing.Size(80, 20)
AddHandler txtBox1.TextChanged, AddressOf txtBox1_Changed 'Adding handler to user created textbox at runtime
form2.Controls.Add(txtBox1)

'creation of txtBox2 at runtime
txtBox2.Location = New System.Drawing.Point(160, 25)
txtBox2.Size = New System.Drawing.Size(80, 20)
AddHandler txtBox2.TextChanged, AddressOf txtBox2_Changed 'Adding handler to user created textbox at runtime
form2.Controls.Add(txtBox2)

'creation of checkbox1 at runtime
checkbox1.Location = New Point(140, 70)
checkbox1.Size = New Size(80, 20)
checkbox1.Text = "Equals"
checkbox1.Checked = False
form2.Controls.Add(checkbox1)

End Sub
Private Sub txtBox1_Changed(sender As Object, e As EventArgs)
check() 'Calling check() subProcedure
End Sub
Private Sub txtBox2_Changed(sender As Object, e As EventArgs)
check() 'Calling check() subProcedure
End Sub
End Class

OUTPUT :

Check (Runing)- Microseft Visual Stadio 1 Quick Launch (Ctri- File Edit View Project Baild Debug Team Tools Test Analyze Wind

1 Quick Launch (Ctri- 刈Check(Running), Microseft Visual Sudio File Edit View Project Baild Debug Team Tools Test Analyze Wind

Check (Runing)- Microseft Visual Stadio 1 Quick Launch (Ctri- File Edit View Project Baild Debug Team Tools Test Analyze Wind

1 Quick Launch (Ctri- Check (Runing)- Microseft Visual Stadio File Edit View Project Baild Debug Team Tools Test Analyze Wind

Add a comment
Know the answer?
Add Answer to:
using Visual Basic>>> Create a form with two text boxes and a checkbox The checkbox should...
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
  • 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.

  • Visual Basic File access Create a form that allow users to enter information (either through text...

    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 C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and...

    Using C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and a button. The three radio buttons should represent the names of three fonts, e.g. “Arial”, “Calibri” and “Times New Roman”. In the one textbox, a user should type a message and in the other textbox, the user should type a size. When the user clicks the button, the label should be updated with the text the user typed in the one textbox, using the...

  • Create a database in visual basic using sql server to use bound text boxes and combo boxes Please...

    Create a database in visual basic using sql server to use bound text boxes and combo boxes Please show step by step with photos

  • Use visual studios language C++ to creat Form1 and Designer Form for question below 3. Form...

    Use visual studios language C++ to creat Form1 and Designer Form for question below 3. Form has three textboxes, two for input and one for output. Form also has five buttons, marked, ‘+’, ‘-’, ‘*’, ‘/’, ‘C’ respectively. User enters integers into the two textboxes, and clicks one of the four buttons (+, - , *, /). The third textbox shows the result of the corresponding operation. For example, if user entered 10 into the first textbox and 2 into...

  • The following form will be used to determine the sales commission of employees. Using Visual Basic...

    The following form will be used to determine the sales commission of employees. Using Visual Basic Studio, build the form with these features:  The checkbox “Target Met” must be disabled.  The title of the form should appear as “Sales Commissions” Write the code to do the following: After entering the totals sales, the checkbox will automatically be checked if the average sales per month was $1,500 or more. Note: The average sales per month can be calculated by...

  • 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...

  • 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...

  • Create and call a function Using the Visual Basic Editor: create a VBA procedure named call_function...

    Create and call a function Using the Visual Basic Editor: create a VBA procedure named call_function that does the following: Prompts the user, using two input boxes, for the height and the radius of the base of a cone. Calls a function named cone_volume and passes the two values to it. Receives a value back from the function and displays it in a message to the user. Create a function named cone_volume that does the following: Receives the two values...

  • Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels,...

    Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...

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
ADVERTISEMENT