Visual Studio C# Getting Started Example ICS2O curriculum.

download Visual Studio C# Getting Started Example ICS2O curriculum.

If you can't read please download the document

Transcript of Visual Studio C# Getting Started Example ICS2O curriculum.

  • Slide 1
  • Visual Studio C# Getting Started Example ICS2O curriculum
  • Slide 2
  • C# Language Overview "C# is intended to be a simple, modern, general-purpose, object-oriented programming language" Developed by Anders Hejlsberg 15 years old created after Java
  • Slide 3
  • Top 10 Programming Languages C# is number 4 IEEE Spectrum, July 19 2014 Stephen Cass Based on "12 metrics from 10 sources (including IEEE Xplore, Google, and GitHub) to rank the most popular programming languages"
  • Slide 4
  • The.NET Framework collection of software/libraries used by Windows applications C# is one of many languages supported by.NET
  • Slide 5
  • Types of Projects Graphical / FormsText / Console
  • Slide 6
  • Project Name You can specify the project name as you create a new project or as you save a project Project name Solution name This is where the solution folder will be created Project name
  • Slide 7
  • Console Applications Hello World
  • Slide 8
  • Forms Applications DESIGN MODE RUN MODE
  • Slide 9
  • Visual Studio Modes Visual Studio has 2 different modes Design Runtime Control properties can be modified at design time (static), or while the program is running (dynamic)
  • Slide 10
  • Visual Studio Environment Visual Studio is a professional integrated development environment (IDE) Tools: Designer Window (1) Solution Explorer Window (2) Properties Window (3) Free versions are available as Visual Studio Express on Microsoft's website (1) (2) (3)
  • Slide 11
  • Forms Basics Form is a container for the controls that the user will use while the program is executing. Add controls from the toolbox TOOLBOX
  • Slide 12
  • Objects Objects are created from their associated Class A Class is like a blueprint which defines the properties and methods/tasks. Form object Label objectsTextBox objects Button objects
  • Slide 13
  • First Set of Controls Forms, Labels, Textboxes, Buttons Form - window that is displayed on the screen which contains other objects. Label displays text within a Form TextBox defined region used to accept text input from a user Button defined area that is used to start an event generated by the user Note: Most of your application code will be associated with a Button Click event. If you double click on Control you will have the opportunity to view/modify the code or actions that will occur when the event happens.
  • Slide 14
  • Using TextBox for Input Textbox GUI control object that is used to obtain keyboard input from the user Example string name = txtName.Text; int age = int.Parse(txtName.age);
  • Slide 15
  • Using Buttons for Events Button Control object for user-generated events. Write code behind for a Button Click
  • Slide 16
  • Using Labels for Output Label GUI control object that is used to display text at a specific location on a form Example lblMessage.Text = "Some Message"; The displayed text is defined by the Text property of the Label The data on the left side of the = operator must be a string
  • Slide 17
  • Using Textbox for Output TextBox GUI control object that is used to display or obtain text at a specific location on a form Example tbMessage.Text = "Some text message"; Set the property ReadOnly to True to displaying text
  • Slide 18
  • Using Dialogs as Output Message box a small window (dialog box) that displays a text Example MessageBox.Show("Some text message"); MessageBox is a Class and not a control on a form To create a message box you call the Show method on the Class. The argument that is passed must be a string
  • Slide 19
  • ICS2O Curriculum Console / GUI Math operations Variables Data type conversions Selection if / booleans Counted loops (for) Random Picturebox (GUI) Timers (GUI) User input (GUI) radio buttons / checkboxes Conditional Loops Listbox Files 1D Array
  • Slide 20
  • Slide 21
  • Resources Used