Lecture Notes for the Windows and .NET Programming Course
Here are well written, illustrated Lecture
Notes for the CS130
Windows and . NET Programming Course at San Jose
State University. These will show you are to get started with
programming user applications in the Microsoft .NET framework (dotNET),
along with some C# programming constructs.
Windows and . Net Programming Lecture Notes:
How
Windows Works Event-driven programming; applications,
windows, and messages.
What messages are and how they are created and "sent". The main message
loop;
the application message queue. Processing messages. WinMain.
The SDK (or
the Win32 API) versus MFC versus .NET--three ways of writing Windows
programs..
Introduction
to Visual Studio. Your
first Windows program. .
Introduction
to Windows Graphics. The Paint event; the Graphics class;
rectangles, clipping, the invalid rectangle. FillRectangle,
DrawRectangle, DrawEllipse.
The
Mouse. Responding to mouse clicks; hit-testing; responding to
double-clicks..
Intermediate
Graphics. Colors, lines and polygons, GraphicsPath
and Region classes..
Introduction
to menus. Creating a menu with Visual Studio, and writing
handlers for the menu items.
Dragging.
Mouse capture; the Capture property; updating on MouseMove.
Use of child windows for dragging. Conversion of coordinates from one
window to another.
Introduction
to printing and arcs,
pies, and area fills.
Controls.
Purposes and uses of pushbuttons, edit boxes, static text boxes, list
boxes, combo boxes, radio buttons, check boxes, spin controls, sliders.
Push
buttons. Using the form editor;
handling the Click event; using the Anchor,
Font, TextAlign, Image, ForeColor, and
BackColor properties.
Modal
Dialogs
Definition of a modal dialog; creating a new form to serve as a dialog;
setting the properties of the form correctly; adding controls; setting
the properties of the controls correctly; bringing up a dialog by
initializing a dialog object, calling its ShowDialog
method, checking the return value, and if it is DialogResult.OK,
then retrieving the data and storing the data in application
member variables. Data validation is not covered in this lecture.
Radio
Buttons and List Boxes..
Creating, initializing, and responding to radio buttons. Creating and
initializing a list box; adding strings to a list box; getting the
current selection; deleting an item. Exchanging data between the form
and a list box. Use of the C# ListArray class and the foreach
construct of C#.
Data
validation. The Validating event and the ErrorProvider class.
Fonts.
Typeface, size, and style; character sets, glyphs, Ascii, Unicode;
raster, stroke, and TrueType fonts; kerning; character and cell height,
internal leading and external leading..
More
on Text and Fonts in .NET. Using
font styles such as bold and italic; using different coordinate systems
to specify fonts; ScaleTransform; calculating
the size and placement of text.
Toolbars
and status bars.
Introduction
to the Windows Common Dialogs. The
ColorDialog, and introduction to the OpenFileDialog and SaveFileDialog.
Common
File Dialogs.. Details of the SaveFileDialog
and OpenFileDialog classes. Disabling Save
until Save As
is used; filename extensions; filter strings; specifying the initial
directory; overwriting files; opening non-existent files; opening
network files; checking file permissions; error handling.
Responding
to the keyboard. Key codes and character codes; keyboard
layouts; KeyUp, KeyDown, and KeyPress
events. The Keys enumeration. Detecting the Alt,
Shift, and Ctrl keys. Using arrow,
tab, and function keys. The Sudoku example
program.
Owner-draw
menus and context menus. We will cover this material
in lab instead of in lecture, since Monday is the Veteran's Day
holiday.
Overview
of The .NET Framework.
Common
Language Runtime (CLR), Framework Class Library (FCL), XML, SOAP. The C
# programming language. Building a Windows Forms Application.
Web
Services. What is a web service? Web Services Definition
Language (WSDL).Writing a
program that uses a web service. Here's a list of some currently
available web services.
Building
.NET Components. A component
is style="font-size: 12pt; font-family: "Times New Roman";">an
object that is reusable and can interact with other objects. How to
build a .NET control component..
In class we'll build a different control than in the lecture
notes--namely a TicTacToe control that displays a
TicTacToe game. We'll use this control in a later lecture.
Introduction
to double-buffering in .NET. Using the Bitmap
class for double-buffering. Doing computations during idle time by
handling the Application.Idle event. Example:
computing and drawing the Mandelbrot set. Here's the example
project in zipped form.
Animation
in .NET. Use of double-buffering together with a
timer to achieve animation. Preventing default processing of EraseBackground
to eliminate flicker. Example: the Balls program
displays bouncing colored balls. If you intend to try to follow along
in class on your laptop, download the file Ball.cs.
Network
programming in .NET. Sockets. Making a connection. Server and
client sockets. The TcpListener and TcpClient
classes in .NET. Asynchronous programming.
class="style1">Notes
revised Dec. 5, 2007, removing some unnecessary (unused) code in the
example. The unused code would be needed to send data, but in this
first example, we are only receiving data.
Network
programming in .NET continued.
Popularity: 8% [?]
Related Posts:





























