A development environment (IDE for short). If you have no experience yet, we recommend the default
:
VS for MS-Windows
.Visual Studio (abbreviated: VS). The default is
VS for MS-Windows
. In some commands, you see screenshots of WinForms apps (still), which you can create only in this version. In other environments, you must first figure out how to achieve the same effect. Also, a teacher or fellow student may be demonstrating something with WinForms: In that case, it’s easiest if you use the same version.
You can use the Community Edition (free license): everything we do in the starting semester can be done in it.
FHICT online workplace
.FHICT also offers an Online FHICT workplace
. See studentenplein
at portal.fhict.nl
.
VS for windows
without having to have MS-Windows installed locally.Visual Studio Code
.If you do not have programming experience yet, we do not recommend this, because some things just work differently from your fellow students and teachers: you may have to figure some things out yourself.
VS for Windows
. This does eat up disk space and may be a bit slower from time to time, but you will have the same IDE as fellow students under Windows.
VS for Mac
: does not support WinForms; short-cut keys are different; otherwise a fine programming environment.Rider: Fast & powerful cross-platform .NET IDE
: supports WinForms. It is part of Jetbrains and through your student account you can use this software for free.Visual Studio Code
: see above.Online FHICT workspace
: see above.For both bootcamp and VM solution you need additional software. This can be found for free in the webshop linked above.
You search the Internet for "Visual Studio 2017 community". For example, here
They call the free version of VS the Community Edition. When installing, choose ".NET desktop development". This version is sufficient for the starting semester. But….
It can also be done through student square on the FHICT portal, under the heading ‘Software’.
Want to know if your VS works? Start up Visual Studio. We will first create a new project and then start typing C# source code. Next, we’ll launch the C# source code. Your first program!
If you this you see after installation, then you are ready to start the next step.
From the File menu, choose New and then Project. See
Make sure you show the blue part exactly the same as yours on the screen. Keywords: "Visual C#" is selected on the left and it says "Windows Forms App (.NET Framework) Visual C#". Give the project a self-selected name at "Name" and then click "OK".
To get to the source code of your first (empty) program we need to make it visible. Right click on ‘Form1’ and choose ‘View Code F7’.
You now see C# source code in the middle. Copy the line below and paste it under the line already there. Make it so that your screen looks the same as below. The point is to add just this line. Some of the names in the lines above and below are named a little differently. This is because in the example program the names may have been chosen slightly differently. That’s not a big deal.
MessageBox.Show(System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String("SGVsbG8gV29ybGQh")));
Essentially, then, you just add "MessageBox…"line under the "InitializeComponent()"line. This line contains a secret code that displays a message to you at startup.
After you have typed C# source code, you must instruct Visual Studio to create (compile) and execute (run) the program. You do that with the "Start" button. You will see a message after execution.
You notice that Visual Studio has two "faces". An editing mode and an execution mode.
editing mode
the most. There you can program buttons and type C# source code. Visual Studio starts up in this mode and in this mode we just added that line of C# source code. In this mode we can start our new program with "Start".Now you may have made a typo in your C# source code. Visual Studio shows that with this screen:
Always choose "No"! Then you can go back to your Visual Studio to see where your typo is.
Typographical errors are indicated by Visual Studio with red circles under the words. Just like in Word. These are sometimes difficult to understand. If so, remove the line and type it again. You can also close the program and revert to a last working version. (Do not save.)
Try opening the designer from Form1 (right-click on Form1 again, just like opening the code). Drag some buttons (buttons), text (labels), and so on onto your Form1. Adjust the color and text. Make it something pretty! If you double-click a button you can use this code to put down that then becomes visible when you press the button. (Paste this code on the empty line between the { and }.
MessageBox.Show("Thank you for clicking!");