Purchase Solution

A simple application in C# in console and window forms

Not what you're looking for?

Ask Custom Question

8a. Create a C# Console Application project following the steps given below.

1. Within the namespace and outside of the wrapper class for Main create a class named assignment8 that inherits from System.Windows.Forms.
2. Instantiate a button control from System.Windows.Forms and name it btnClickMe.
3. Instantiate a button control from System.Windows.Forms and name it btnExit.
4. Set the form title bar to display "Assignment 8".
5. Set the form size properties to 300, 150.
6. Set the btnClickMe text to "Press Me" and the btnExit text to "Exit".
7. Add the two button controls to the form.
8. Set the btnClickMe location to coordinates 15, 20 and the btnExit location to coordinates 15, 60.
9. Register a new EventHandler for the Click event of the btnClickMe button and a new EventHandler for the Click event of the btnExit button.
10. Write the btnClickMe_Click event method and code the method to show a messagebox with "The Button Has Been Clicked" as text and "Click Me" in the MessageBox title bar when the Click event is fired.
11. Write the btnExit_Click event method and code the method to exit the application when the Click event is fired.
12. In Main run/instantiate an assignment8 form.

8b. Create a C# Windows Forms Application project following the steps given below.

1. Recreate an exact copy of the above console application project to drag and drop the controls onto the form.
2. Use the same property settings for the form and buttons as you did in the console application.

Purchase this Solution

Solution Summary

A simple application in C# with two buttons which have a specific position and text and dsiplay a message box. Part A) of this task is done as a console application and part B) is an exact copy but as a Windows form application created in VS designer.

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.