Download presentation
Presentation is loading. Please wait.
Published byLenard Hardy Modified over 9 years ago
1
DT265-2 Object Oriented Software Development 2 Lecture 3 : Windows Programming Lecturer Pat Browne patrick.browne@dit.ie
2
Windows Dialogs
3
Components From Windows Forms Programming with C# by Erik Brown
4
Menu Class From Windows Forms Programming with C# by Erik Brown
5
Status Bar Class From Windows Forms Programming with C# by Erik Brown
6
Windows Dialogs From Windows Forms Programming with C# by Erik Brown
7
Using C# in easy steps 1.Getting Started 2.Controls explained 3.C# language essentials 4.Object essentials 5.Visual studio tools 6.C# techniques 7.Creating database programs 8.Running C# on the internet
8
C# in easy steps : 1 Getting Started Introduction C# and other languages Installing C# Making Sense of the IDE Your First Application First look at Toolbox First Look at Property Editor Getting to know C# forms Placing a button First look at events Your First line of code Setting properties in code A C# adding machine Dealing with errors Help First look at solution Explorer Saving your project Reopen Application
9
C# in easy steps : 2 Controls Explained Controls and Methods Using buttons and labels Using TextBoxes Using Picture Boxes Using CheckBoxes Using RadioButtons Using ListBoxes Using ComboBoxes The OpenFileDialog Control Using the timer Using the TabControl Using the SplitterControl Using Toolbar and RichTextBox (paste data from Word Document) Using MonthCalendar Control Setting tab order Some other controls Using Anchor and Dock properties
10
C# in easy steps : 3 C# Language Essentials Introduction Start at the beginning The parts of a C# file Introduction to data types Doing sums Curly brackets and semicolons Functions and parameters Giving variables a value Variables and scope Using if.. else.. Using do and while Using for loops Using Switch Arrays: dealing with a set of values. Using structs Using enums for a range of values Understanding reference types Working with parameters More about casting
11
C# in easy steps : 4 Object Essentials Object essentials A first object Classes and objects Constructors and destructors Using Add Field and Add Property A list of books Working with collections Inheritance Encapsulation and interface Overloading and overriding Static members Protected and internal members Understanding Namespaces The using directive Object lifetime The using statement
12
C# in easy steps : 5 Visual Studio Tools Creating a Menu, customizing & popup Making a menu work Working with the code editor Using Clipboard Ring Using Find Introducing the debugger Using Breakpoints The locals and watch windows Tracking down errors Customizing the Toolbox Using the Add-in Manager Explaining the Reference Manager Setting Visual C# options Setting project properties Creating a standalone applications Where Help comes from
13
GUI events
14
C# Windows application
15
Mouse Events The mouse is a primary interface for doing graphics in Visual C# Express. A program needs to recognize mouse events in controls. Many controls recognize mouse events.
16
Mouse Events private void panel1_MouseDown(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: label1.Text = "Left"; break; case MouseButtons.Middle: label1.Text = "Middle"; break; case MouseButtons.Right: label1.Text = "Right"; break; } label2.Text = Convert.ToString(e.X) + "," + Convert.ToString(e.Y); }
17
Mouse Events
18
Write Windows version of Location Quotient program Make Windows version of LQ program Invoke from menu, button or any other way. Read file. Perform LQ computation. Print results in list box.
19
SharpMap-0.9-Trunk-2012.04.17 Download and install Sharpmap from http://sharpmap.codeplex.com/releases/view/87500 http://sharpmap.codeplex.com/downloads/get/376940 SharpMap-0.9-AnyCPU-Trunk-2012.04.17 Place with your other VisualStuidio projects. Download and run SharpmapDemo from http://spatialhorizons.com/category/sharpmap/ Download
20
Generating Irish Grid letter The Irish National Grid is a coordinate reference system for Ireland. It is measured in metres with a range (0,0) to (500,000,500,000). For ease of reference a set of labelled grid squares are used. These are A to Z with no I. The code below accepts an ING coordinate and returns the grid square that contains the coordinate.
21
Generating Irish Grid letter See http://www.gridreference.ie/ http://www.dorcus.co.uk/carabus//ll_ngr.html http://www.simonstewart.ie/position/irishgrid.htm See code in notes section Tasks – Get input data from a CSV file – Write results to a CSV file – Prompt used for input/output files – Allow user to enter number specifying the number of digits in the output (0-6)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.