Exercise: Hello CSharp
- In the Solution Explorer, find the main project (Marked in Bold).
- Add a folder called Exercises
- Add a class called "HelloCSharp" (don't use the # sign, it's an invalid character in a class name)
- Add the run method
public void Run()
{
}
- Add a call to the
System.Windows.Forms.Show
method - In the Views folder find the ApplicationMdi form and open it the Visual Studio’s form designer.
- Add a new menu called “Exercises”
- Add a new entry called “Hello C#”
- When clicking the menu, call the "HelloCSharp" class we've just created.
new Exercises.HelloCSharp().Run();
- Add comments to describe your code.
- Build and run.
- In the beginning of the file, add using directive to
System.Windows.Forms
namespace - Add another message box, using shorter syntax, to show the following message: “Shorter is better”
- Build and run.
- Using the “mbox” snippet, add another message box to show the following message: “Snippets are cool!”
- Build and run.
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com