Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

185 Chapter How to code methods and event handlers Add an event handler for the TextChanged events 8. In the Form Designer, select the first

image text in transcribed

image text in transcribed

185 Chapter How to code methods and event handlers Add an event handler for the TextChanged events 8. In the Form Designer, select the first text box. Then, click the Events button in the Properties window to display the Events list for that text box Review the events that are available. Enter "Clear Future Value" to the right of the TextChanged event and press Enter. When you do, the Code Editor will open and an event handler named Clear Future Value will be created. Enter a statement that clears the Future Value text box as shown in figure 6-9. 10. Open the Form 1.Designer.es file for the form, expand the Windows Form Designer generated code region if necessary, and locate the statements that set the properties of the Monthly Investment text box. At the end of those statements, you'll find a statement that wires the TextChanged event of this control to the ClearFuture Value event handler. Return to the Form Designer and select the Yearly Interest Rate text box. Drop down the list for the TextChanged event of this control, and notice that the Clear Future Value event handler is included in this list. Select this event handler to wire the event to it. Repeat this process for the Number of Years text box. 12. Run the application and perform a calculation. Then, change the value that's displayed in one of the text boxes. When you do that, the value that's displayed for the Future Value text box should be cleared. 13. When you're sure the enhancements are working correctly, close the application. Exercise 6-2 Experiment with events This exercise will give you a chance to experiment with events and the event wiring for the Future Value application. Generate and delete an event handler 1. Open the Future Value application that you enhanced in exercise 6-1. 2. In the Form Designer, double-click on the form to generate the handler for the default event of a form, which is the Load event. Then, delete this event handler in the Code Editor, and try to build and run the application. This should lead to one build error. 3. Double-click on the error message, which will lead you to the event wiring for the event handler. Then, delete that wiring, and try to build and run the application again. This time, it should work. TRAINING & REFERENCE MURACH murach's C# 2015 ANNE BOEHM JOEL MURACH A SELF-PACED, PROFESSIONAL BOOK that shows you how to use Visual Studio, C#, and the .NET classes to develop Windows Forms applications AN OBJECT-ORIENTED BOOK that shows you how to use business classes, inheritance, and interfaces the way they're used in the real wodd AN INTRODUCTION TO DATABASE PROGRAMMING that gets you started developing professional database applications with data sources, ADO.NET code, and the Entity Framework A GUIDE TO WORK-SAVING VISUAL STUDIO AND C# FEATURES including 2015 features like Live Code Analysis, Code Lens, and expression-bodied functions, as well as earlier features like lambda expressions and LIN

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

Progress Monitoring Data Tracking Organizer

Authors: Teacher'S Aid Publications

1st Edition

B0B7QCNRJ1

More Books

Students also viewed these Databases questions