CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg,

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
C# Programming: From Problem Analysis to Program Design1 Introduction to Windows Programming C# Programming: From Problem Analysis to Program Design 3.
DT265-2 Object Oriented Software Development 2 Lecture 3 : Windows Programming Lecturer Pat Browne
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
CS 2340: Programming in VB Instructor: Dr. Qi Yang Office: 213 Ullrich Phone: YangQ 1.
Visual Basic Chapter 1 Mr. Wangler.
CS 2340 Programming in VB.NET Instructor: Dr. Qi Yang Office: 213 Ullrich Phone: YangQ 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
IE 411/511: Visual Programming for Industrial Applications
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
Week 2: WINDOWS PROGRAMMING Chapter 15 in “Beginning Visual C# 2010” ebook Chapter 4 in “”MCTS_Self-Paced_Training_Kit” ebook.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
 2009 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2008 IDE.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Introduction to VB programming Dr. John P. Abraham UTPA Chapters 2 & 3.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Object Orientated Programming using C#
Chapter 1: An Introduction to Visual Basic 2015
Introduction to Computer CC111
CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming UTPA – Fall 2012 This set of slides is revised from lecture.
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Introduction to the Visual C# 2005 Express Edition IDE
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Chapter 2 Visual Basic Interface
المحاضرة الأولى Lab(1) أ.ساره الأحمدي برمجة حاسب 2.
The University of Texas – Pan American
CIS16 Application Development Programming with Visual Basic
CSCI 3328 Object Oriented Programming in C# Review: Exam I
CSCI 3328 Object Oriented Programming in C# Review: Exam I
Visual Studio.
The University of Texas – Pan American
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Week 2: WINDOWS PROGRAMMING
Presentation transcript:

CSCI 3328 Object Oriented Programming in C# Chapter 2: Introduction to Visual C# Programming 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX

Objectives In this chapter, you will –Become familiar with the IDE, Visual Studio –Learn more controls of Visual C# programming –Discover differences between different controls –See more examples of designing the graphical interface –Become aware of the console application, in addition to windows forms application 2

Demo in the Class form label button Text BackColor 3

Integrated Development Environment (IDE) 4

Integrated Development Environment (cont'd) Menu bar –File: Open/New/Save/Close projects or files –Edit: Undo/Redo, Copy, Paste, Cut –View: Other Windows  Properties –Build –Debug: Start Debugging, Step Into, Step Over 5

Integrated Development Environment (cont'd) Buttons –For files and edit –For compilation –For debugging If some buttons do not appear, right click your mouse on the tool bar and customize buttons 6

Integrated Development Environment (cont'd) Windows PropertiesSolution Explorer events show all files 7

Visual C# Controls Choose Windows forms application What you see is the IDE (Integrated Development Environment) Use Sizing handle to make the form Adjust the size of the properties window In the toolbox –Use common controls Start placing objects on the form Place a button, label it OK and add code this.Close() 8

Controls 9

TextBox Difference between label and text boxes Properties window –Changing name and text –Border Style –BackColor –Font Size –Visible –TabIndex 10

PictureBox Properties –Image  Local resource  Import –SizeMode: Normal, Stretch Image, AutoSize, CenterImage, Zoom 11

GroupBox Properties –Text RadioButton –Checked = "false" –Add radio buttons to the group box –At most one radio button is checked at a time CheckBox –0 or any number of boxes are checked 12

Other Interesting Controls ProgressBar –Value: 50 ListBox –Items: enter strings one per line ComboBox 13

Adding a Pop-Up Message Box Add a form to the application Add this line MessageBox.Show("Hello!"); MessageBox.Show("Hello!", "Show Message"); 14

Example of GUI Design Notepad GUI –Menu strip –Rich TextBox 15

Example of GUI Design (cont'd) Calendar GUI –Label –MonthCalendar –RichTextBox 16

Analyzing a Program Line numbers: not part of Visual C# Comments: (Lines 23-29) Classes: class declaration (Lines 12-31) Keywords: Case sensitive (the same as C++) public, private, class partial 17 event handling

Variable Declaration and Naming Variable declaration –Same as C++ Data types: int, float, double, char, etc. Variable name: (1) digits, letters, underscore ("_"), and (2) cannot start with a digit int x = 1; int x = 0, y = 1; Naming convention –Camel case: e.g. firstNumber 18

Assignment Use DOT (.) to refer to attributes of an object –E.g., Label1.Text Use assignment operator (=) to give a value to a variable –E.g., Label1.Text = "haha" 19

Applications In addition to Windows Forms Application, … Console –Output appears in console window –From Visual Studio choose C# and choose a new project, and choose Console Application –Give it a name 20

Demo of Hello Program string name; name=Console.ReadLine(); Console.WriteLine("Hello! " + name); Console.WriteLine("Welcome to Dr. Lian's C# Class!"); Console.ReadLine(); 21

Demo of Hello Program (cont'd) 22

Summary IDE –Menu bar, buttons, windows, toolboxes Controls –TextBox, PictureBox, GroupBox, etc. GUI design –Examples Program analysis Windows Forms Application vs. Console Application 23