Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this exercise you are asked to write a Windows Forms application meeting the following specification. You may follow the worksheet for Practical 7 for

For this exercise you are asked to write a Windows Forms application meeting the following specification. You may follow the worksheet for Practical 7 for step-by-step instructions on how to complete it.

The Form class must be named Form1. This is the default when creating a new Windows Forms app, but make sure that it doesn't change.

The form must be captioned Click Counter.

The form must contain a button with the text Click Me.

The form must contain a label with the initial text 0 times.

The form must contain a button with the text Reset. This button must start out disabled.

Whenever the Click Me button is clicked, the count in the label must increment (first to 1 times, then to 2 times and so on.)

The Reset button must be enabled when the Click Me button is clicked.

Whenever the Reset button is clicked, the count in the label must reset to 0 times.

Clicking the Reset button causes the Reset button to be disabled.

Screenshot of the program in its initial state:

Writing the program

For this activity you are not given sample code because Visual Studio creates a substantial framework for you already.

Here are some specific points to ensure when you are working on your program to ensure that AMS can work with it:

Make sure you create a Visual C# Windows Forms App (.NET Framework) when creating the project in Visual Studio.

The solution should be named PushCounter. This is not necessary; however the namespace must be named PushCounter and naming the solution PushCounter is a good way to ensure that it is correct by default.

The form must be named Form1. This is the default form name when creating a Windows Forms App.

Ensure that your buttons, captions etc. contain the text they are required to. The names of the buttons in the source code is irrelevant; however, the text on the buttons is used to find them within the form. The same is true for labels, checkboxes and any other form elements.

Submitting the solution

GUI applications require a slightly different process for submitting to AMS than previous, single source file exercises. This is because GUI applications in Visual Studio are automatically split across multiple files, which means multiple files need to be submitted for your program to be marked correctly.

When you create a new Windows Forms app, there are three C# source files created by default, which you can see in the solution explorer. You may have to expand the 'Form1' tab to see the Form1.Designer.cs file.

Program.cs - This is the entry point for the application and does nothing by default except showing Form1. You do not need to submit this file for the solution.

Form1.cs - This is the class that contains the code associated with your application. When you click on Form1.cs in the solution explorer it will normally show the GUI view. Right-click on Form1.cs and click 'View Code'. When you double-click on a button or create a new event attached to an element on this form Visual Studio will open up this file for you. You need to submit this file.

Form1.Designer.cs - This class contains code that is automatically generated by Visual Studio. You should not need to manually modify any of the code in this file - when you add and change elements in the GUI designer for Form1 Visual Studio will add code to this file. You need to submit this file too.

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago