Install Visual Studio 2017 and Learn Basic C#

Learn C#
Spread the love

Learn Basic C# using Visual Studio 2017

This Post is to help show the steps of installing Visual Studio 2017 community version, and building your first WPF application in ASP.NET C#. These are some basics to learning C#.

The first step is to go to https://www.visualstudio.com/downloads and download VS 17.

Click the Download button, and run once it has installed.

When the VS installer loads select the packages you want. For our Install we selected.

  • Universal Windows Platform development
  • .Net desktop Development
  • Asp.Net and Web development

Install may take awhile and may require a reboot.

 

Once you have VS 2017 Installed.

  1. Open VS
  2. File -> New -> Project ->Windows Classic Desktop -> WPF  App (.NET Framework)
  3. click MainWindow.xaml
    1. Add a Textbox and a TextBlock to MainWindow.
      1. Name the TextBox txtbox1 and the textBlock txtBlock1
    2. Add a Btn to MainWindow
      1. name Btn1
  4. Add following code to your MainWindow.xaml.cs (Inside the namespace “YourProjectName” curly brackets (‘{‘))
  5. public partial class MainWindow : Window
    {
    public MainWindow()
    {
    InitializeComponent();
    txtBlock1.Text = “Howdy Youtube!”;
    }public void updateTxtBoxText()
    {
    //Update teh Txt block to equal the txtbox text.
    txtBlock1.Text = txtBox1.Text;
    }private void btn1_Click(object sender, RoutedEventArgs e)
    {
    //Call update txt box when btn is pressed.

    Visual Studio Solution Explorer
    Visual Studio Solution Explorer
  6. updateTxtBoxText();
    }
    }
  7. Click Run Debug and watch the result.

 

 

 

 

 

Leave a Reply

avatar
  Subscribe  
Notify of
Hey I see you are using an Ad blocker. Ads really help to keep this website up and going. Please consider white-listing us. If not it's cool, I understand.