Visual C# courseware and training manuals

In addition to course manuals specific to programming in C#, we also have courseware for the Windows Forms and WPF user interfaces:

You can see details of how to license our Visual C# courseware (including volume requirements) here.


Visual C# courseware

Here is a list of all of our Visual C# manual chapters (you can download the ones marked):

Chapter Sections Subsections
Windows Forms Applications (4 pages) WinForms and WPF Compared A Typical WinForms Application ; The Same Application in WPF ; How WPF Forms are Stored ; Differences between WinForms and WPF
Coding WinForms and WPF Forms
Visual Studio Basics (10 pages) Setting the Default Start-up Page
Creating Appropriate Settings
Creating Projects Choices of Programming Languages for Projects ; Creating New Folders for Projects
Saving and Closing Files and Projects Closing One Window ; Closing All or Nearly All Windows ; Moving Between Windows ; Saving and Closing a Project
Auto-hidden, Docked and Floating Windows Auto-Hidden Windows ; Docked Windows ; Floating Windows
The Three Most Useful Windows Solution Explorer ; Properties Window ; The Toolbox ; Displaying the Main Windows
Drawing Forms (14 pages)

Download this chapter
Creating a New Form
Setting Useful Form Properties
Controls and the Toolbox Definition of Controls ; Using the Toolbox
Adding Controls to a Form
Naming Controls Modified Hungarian Notation ; A List of Three-Letter Prefixes
Selecting Controls Selecting a Single Control ; Selecting Several Controls ; Selecting All Controls ; The Dominant Control ; Changing the Dominant Control
Formatting Controls and Forms Resizing Controls ; Changing how Controls Look ; Moving Controls ; Changing Alignment (within Controls) ; Changing Control Alignment Relative to the Form ; Aligning Controls against Each Other ; Making Controls the Same Size ; Spacing Controls Equally
Navigating in a Form Accelerator Keys ; Tab Order ; Default Buttons
Tooltips
Copying and Editing Forms (2 pages) Copying Forms
How Visual Studio Creates Forms
Running Applications (4 pages) Setting the Default Project/Form
Building a Project Manually Building a Project or Projects ; Dealing with Build Errors
Running and Stopping an Application Running an Application ; Stopping an Application
Form events (8 pages) Events Event Terminology
Attaching Code to a Control or Form Attaching Code to a Control’s Default Event ; Creating a New Event-Handler for an Event ; Handling an Event with an Existing Routine
Switching Between Form Design and Code View Using the Keyboard ; Using Solution Explorer
Those Strange Event Arguments Renaming an Event Subroutine ; Every Event Passes Two Arguments ; Argument 1 – The Object that Called the Event ; Argument 2 – The Event Arguments
Running Code on Form Load
Coding in C# (10 pages) Using AutoCompletion Methods and Properties
THIS and ENVIRONMENT Using THIS to Make Typing Easier ; Using ENVIRONMENT to Get Information
Commenting and Uncommenting Code Commenting Out Code
Laying Out Your Code Statements Spanning Multiple Lines ; Indentation of Code ; Using Code Regions
Find and Replace
Handling Syntax Errors Viewing Syntax Errors ; Using the Error List Window ; Showing Line Numbers ; What the Yellow and Green Lines Mean
Displaying Messages The Parts of a Message Box you can Customise
Code Snippets Using Code Snippets
Variables and Data Types (14 pages) Why Use Variables?
Declaring Variables Declaring Variables ; Using Modified Hungarian Notation ; Default Values for Variables ; Problems with Declaring Variables within Clauses
Setting Values in Variables Declaring Integer Variables and Adding/Subtracting ; Accumulating Text in String Variables
Variable Data Types Mapping C# Data Types to the CLR Runtime ; A Lazy Person’s Data Types ; Logical Values ; Integers ; Decimal (Floating Point) Numbers ; Strings and Text ; Dates and Times ; Objects
Converting Variables Conversion Using Convert.To ; ToString() – Special Case for String Conversions ; Casting Data Types
Variable Scope
Notes on Working with Specific Data Types Working with Strings ; Escape Characters ; Splitting Strings ; Formatting Dates ; Working with Numbers – Possible Operations
Testing Data Types
Enumerations and Constants (4 pages) Enumerations What are Enumerations, and Why Use Them? ; Declaring Enumerations ; Giving Enumerations Data Type and Values ; Other Examples of Enumerations
Constants
Using Resources Using a Resource
Conditions and Loops (6 pages) Conditions Using IF for Conditions ; Using the More Elegant SWITCH statement
Looping in C# Looping Over a Collection/Array ; Looping a Given Number of Times ; Looping While a Condition is True
Breaking Out of Loops
Arrays (4 pages) Overview of Arrays Setting Array Values
Listing Array Elements
Basing ComboBoxes or ListBoxes on Arrays Sorting Arrays
Splitting strings into arrays
Simple Form Controls (8 pages) Types of Text Box Multiple Line Text Boxes ; Formatted Text Boxes ; Masked Text Boxes ; NumericUpDown Controls
Entering Dates DateTimePicker Controls ; MonthCalendar Controls
WebBrowser Controls
Using GroupBoxes and Panels Using Panels ; Using GroupBoxes ; Container Tab Order
Properties (4 pages) Designing Properties Three Types of Property
Creating Properties Read-Only Property (Product Name) ; Write-Only Property (Results) ; Read-Write Property (Quantity)
Using Properties
Lists (6 pages) Overview Example of List Code
Basic List Commands Creating a List ; Adding Items to a List ; Counting the Items in a List ; Displaying All of the Items in a List (FOR EACH) ; Removing Items from a List
Finding Particular Items in a List The Various Find Methods ; Lambda Expression Syntax for Find Methods ; Getting a Subset of a List – Method 1: Using FindAll ; Getting a Subset of a List – Method 2: Using GetRange
Working with Strings Joining List Items Together ; Splitting Text into a List
Modular Programming (4 pages) What is Modular Code? A Coding Example
Passing Arguments What is an Argument? ; Types of Argument ; Examples of Each Type of Argument
Optional Arguments An Alternative Method: Using Different Signatures
Functions (2 pages) Procedures versus Functions Specifying a Function ; Code for Functions
Incorporating Functions in Programs
Validation of Forms (6 pages) Overview of Validation Controls to Use to Avoid Validation
Validating Controls and Forms Validation Events ; Configuring your Cancel Button ; A Typical Validation Routine
Error Providers Adding Error Providers ; Setting and Cancelling ErrorProviders in Code
Validation the Hard Way
Creating menus (8 pages) Anatomy of a Menu
Creating a Menu Adding a MenuStrip Control to your Form ; Creating Menu Items ; Adding Separators to Menus ; Naming your Menus ; Assigning Macros to Menus
Short-Cut Keys Assigning Shortcut Keys to Menus ; Adding Additional Shortcut Keys
Checking and Enabling Menus
Context (Short-Cut) Menus Working Out Which Context Menus You Need ; Creating a Context Menu ; Assigning Context Menus to Controls ; Coding Context Menus
Toolbars and Status Bars (6 pages) Toolbars – What You Should Know
Creating Toolbars Creating and Naming a Toolbar ; Positioning the Toolbar below the Menu ; Initialising the Tools on your Toolbar ; Adding your own Tools
Assigning Code to Toolbars
Status Bars Creating Status Bars ; Adding a Status Label to the Status Bar
Adding a Progress Bar to your Status Bar
Coding menus and toolbars (8 pages) About this Chapter Our Example – Googlewhacking ; Sharing Code between Menus, Toolbars, Keys and Context Menus
Enabling/Disabling Our Tools and Menus Properties to Determine if Actions are Possible ; A Routine to Conditionally Enable/Disable Menus and Toolbars ; Running our Enabling/Disabling Code
Getting the Actions to Work Creating the Action Routines ; Assigning the Actions to the Toolbar ; Assigning Actions to the Menu
Keyboard Shortcuts
Working with files and folders (10 pages) The Different File and Folder Dialog Boxes
Adding File or Folder Dialog Boxes to a Form Adding Dialog Box Controls Graphically ; Creating and Displaying Dialog Boxes Programmatically
Parts of a File Dialog Box
Customising a File Dialog Box File Filters ; File Extensions ; Allowing Read-Only Files ; Selecting Multiple Files ; Setting and Restoring the Initial Directory ; Checking if Files/Folders Exist ; Checking How to Proceed if Files Exist
Browsing for a Folder
Reading and Writing Files Our Example ; Referencing the System.IO Namespace ; Writing Out a Mortgage Application Line ; Reading in the Mortgage Application File
Debugging and Error Handling (12 pages) Catching Errors Syntax of the Try / Catch Statement ; Our Example for Validating Numbers ; Catching Specific Errors
Reacting to Errors
Debugging Setting (and Unsetting) a Breakpoint ; Starting to Debug ; Changing the Next Executable Line ; Stepping Through Code ; Viewing Variables ; Stopping Debugging
The Immediate and Output Windows Displaying the Windows ; Requesting Current Program Information ; Changing Variable Values while Debugging ; Writing to the Immediate or Output Window ; Useful Debug Commands ; Controlling which Window Debug Goes To
Other Debugging Tools Conditional Breakpoints ; Watching Variables ; The Call Stack
Linking to Databases (4 pages) Choosing a Database Application
Our Example
Data Sources, TableAdapters and DataSets DataSets ; DataSources ; How TableAdapters Work ; Standard Methods for TableAdapters
Data Sources (4 pages) Creating DataSources Starting the Data Source Wizard ; Creating a Connection to the Database ; Choosing Tables and Views
Viewing and Editing Data Sources and Datasets The Data Sources Window ; Editing Datasets
ComboBoxes and ListBoxes (4 pages) ComboBoxes and ListBoxes The Difference between ComboBoxes and ListBoxes ; Creating ComboBoxes or ListBoxes
Data Bound ComboBoxes and ListBoxes Display and Value Members ; Making a Combo Box Data Bound
Sorting a ComboBox or ListBox Starting to Configure the TableAdapter ; Changing the Sort Order of the Query
DataGridViews (10 pages) Introduction to DataGridViews Creating a DataGridView the Easy Way
Creating a DataGridView Manually
Adding, Editing and Deleting Columns
Formatting and Using Styles How Default Styles Work ; Setting an Overall Default Style ; Formatting Alternating Rows a Different Colour ; Setting a Column and Row Heading Style ; Setting Styles for a Specific Column ; Formatting Numbers or Dates
Changing DataGridView Size Making a DataGridView Stretchy ; Making the Last Column of Variable Width ; What Happens when you AutoSize Columns/Rows
Sorting DataGridViews
Disabling Inserting and Deleting
Making DataGridViews Editable (4 pages) Writing Changes to a Database
Checking your TableAdapter has Update Statements Configuring the TableAdapter ; Method 1 – Generate your SQL Update Statements ; Method 2 – Ensure the Statements are Created
Writing Changes to your Database Why Doesn’t My Update Method Work?
Reacting to DataGridView Events (10 pages) Overview of DataGridView Events Useful Standard Event Properties
Typical Event-Driven Tasks Using an Enumeration to Number Columns ; Conditional Formatting ; Setting Default Values for New Records ; Asking for Confirmation when Deleting Rows
Validating Data Entered Validating Row by Row ; Handling Errors by Individual Cell ; Checking Whole Rows ; Showing Error Icons ; Checking Parsing has Worked
The Order of Validation Events
Advanced DataGridView topics (14 pages) The Ultimate C# Application
Adding Buttons to a DataGridView Creating your Button ; Setting Properties for the Button ; Coding your Button
Adding a Bound Combobox Adding the New Dropdown Column ; Linking the New Column to a Table
Getting the DataGridView to Filter Creating the Filter ComboBox ; Hiding the DataGridView Initially ; Adding a Filter to the DataGridView ; The TableAdapter Query Configuration Wizard ; Filtering the DataGridView when the ComboBox Changes
Creating a Single Client Editing Form Creating a Single Record Form ; The BindingNavigator Control ; Attaching Code to the DataGridView Control ; Attaching Code to Load the Single Record Form ; Saving a Record in the Single Record Form
Deploying Applications (2 pages) Publishing Applications
Installing a Published Application

WinForms - Visual C# courseware

Here is a list of all of our WinForms - Visual C# manual chapters (you can download the ones marked):

Chapter Sections Subsections
Windows Forms Applications (4 pages) WinForms and WPF Compared A Typical WinForms Application ; The Same Application in WPF ; How WPF Forms are Stored ; Differences between WinForms and WPF
Coding WinForms and WPF Forms
Visual Studio Basics (10 pages) Setting the Default Start-up Page
Creating Appropriate Settings
Creating Projects Choices of Programming Languages for Projects ; Creating New Folders for Projects
Saving and Closing Files and Projects Closing One Window ; Closing All or Nearly All Windows ; Moving Between Windows ; Saving and Closing a Project
Auto-hidden, Docked and Floating Windows Auto-Hidden Windows ; Docked Windows ; Floating Windows
The Three Most Useful Windows Solution Explorer ; Properties Window ; The Toolbox ; Displaying the Main Windows
Drawing Forms (14 pages)

Download this chapter
Creating a New Form
Setting Useful Form Properties
Controls and the Toolbox Definition of Controls ; Using the Toolbox
Adding Controls to a Form
Naming Controls Modified Hungarian Notation ; A List of Three-Letter Prefixes
Selecting Controls Selecting a Single Control ; Selecting Several Controls ; Selecting All Controls ; The Dominant Control ; Changing the Dominant Control
Formatting Controls and Forms Resizing Controls ; Changing how Controls Look ; Moving Controls ; Changing Alignment (within Controls) ; Changing Control Alignment Relative to the Form ; Aligning Controls against Each Other ; Making Controls the Same Size ; Spacing Controls Equally
Navigating in a Form Accelerator Keys ; Tab Order ; Default Buttons
Tooltips
Copying and Editing Forms (2 pages) Copying Forms
How Visual Studio Creates Forms
Running Applications (4 pages) Setting the Default Project/Form
Building a Project Manually Building a Project or Projects ; Dealing with Build Errors
Running and Stopping an Application Running an Application ; Stopping an Application
Form events (8 pages) Events Event Terminology
Attaching Code to a Control or Form Attaching Code to a Control’s Default Event ; Creating a New Event-Handler for an Event ; Handling an Event with an Existing Routine
Switching Between Form Design and Code View Using the Keyboard ; Using Solution Explorer
Those Strange Event Arguments Renaming an Event Subroutine ; Every Event Passes Two Arguments ; Argument 1 – The Object that Called the Event ; Argument 2 – The Event Arguments
Running Code on Form Load
Coding in C# (10 pages) Using AutoCompletion Methods and Properties
THIS and ENVIRONMENT Using THIS to Make Typing Easier ; Using ENVIRONMENT to Get Information
Commenting and Uncommenting Code Commenting Out Code
Laying Out Your Code Statements Spanning Multiple Lines ; Indentation of Code ; Using Code Regions
Find and Replace
Handling Syntax Errors Viewing Syntax Errors ; Using the Error List Window ; Showing Line Numbers ; What the Yellow and Green Lines Mean
Displaying Messages The Parts of a Message Box you can Customise
Code Snippets Using Code Snippets
Variables and Data Types (14 pages) Why Use Variables?
Declaring Variables Declaring Variables ; Using Modified Hungarian Notation ; Default Values for Variables ; Problems with Declaring Variables within Clauses
Setting Values in Variables Declaring Integer Variables and Adding/Subtracting ; Accumulating Text in String Variables
Variable Data Types Mapping C# Data Types to the CLR Runtime ; A Lazy Person’s Data Types ; Logical Values ; Integers ; Decimal (Floating Point) Numbers ; Strings and Text ; Dates and Times ; Objects
Converting Variables Conversion Using Convert.To ; ToString() – Special Case for String Conversions ; Casting Data Types
Variable Scope
Notes on Working with Specific Data Types Working with Strings ; Escape Characters ; Splitting Strings ; Formatting Dates ; Working with Numbers – Possible Operations
Testing Data Types
Enumerations and Constants (4 pages) Enumerations What are Enumerations, and Why Use Them? ; Declaring Enumerations ; Giving Enumerations Data Type and Values ; Other Examples of Enumerations
Constants
Using Resources Using a Resource
Conditions and Loops (6 pages) Conditions Using IF for Conditions ; Using the More Elegant SWITCH statement
Looping in C# Looping Over a Collection/Array ; Looping a Given Number of Times ; Looping While a Condition is True
Breaking Out of Loops
Arrays (4 pages) Overview of Arrays Setting Array Values
Listing Array Elements
Basing ComboBoxes or ListBoxes on Arrays Sorting Arrays
Splitting strings into arrays
Simple Form Controls (8 pages) Types of Text Box Multiple Line Text Boxes ; Formatted Text Boxes ; Masked Text Boxes ; NumericUpDown Controls
Entering Dates DateTimePicker Controls ; MonthCalendar Controls
WebBrowser Controls
Using GroupBoxes and Panels Using Panels ; Using GroupBoxes ; Container Tab Order
Properties (4 pages) Designing Properties Three Types of Property
Creating Properties Read-Only Property (Product Name) ; Write-Only Property (Results) ; Read-Write Property (Quantity)
Using Properties
Lists (6 pages) Overview Example of List Code
Basic List Commands Creating a List ; Adding Items to a List ; Counting the Items in a List ; Displaying All of the Items in a List (FOR EACH) ; Removing Items from a List
Finding Particular Items in a List The Various Find Methods ; Lambda Expression Syntax for Find Methods ; Getting a Subset of a List – Method 1: Using FindAll ; Getting a Subset of a List – Method 2: Using GetRange
Working with Strings Joining List Items Together ; Splitting Text into a List
Modular Programming (4 pages) What is Modular Code? A Coding Example
Passing Arguments What is an Argument? ; Types of Argument ; Examples of Each Type of Argument
Optional Arguments An Alternative Method: Using Different Signatures
Functions (2 pages) Procedures versus Functions Specifying a Function ; Code for Functions
Incorporating Functions in Programs
Validation of Forms (6 pages) Overview of Validation Controls to Use to Avoid Validation
Validating Controls and Forms Validation Events ; Configuring your Cancel Button ; A Typical Validation Routine
Error Providers Adding Error Providers ; Setting and Cancelling ErrorProviders in Code
Validation the Hard Way
Creating menus (8 pages) Anatomy of a Menu
Creating a Menu Adding a MenuStrip Control to your Form ; Creating Menu Items ; Adding Separators to Menus ; Naming your Menus ; Assigning Macros to Menus
Short-Cut Keys Assigning Shortcut Keys to Menus ; Adding Additional Shortcut Keys
Checking and Enabling Menus
Context (Short-Cut) Menus Working Out Which Context Menus You Need ; Creating a Context Menu ; Assigning Context Menus to Controls ; Coding Context Menus
Toolbars and Status Bars (6 pages) Toolbars – What You Should Know
Creating Toolbars Creating and Naming a Toolbar ; Positioning the Toolbar below the Menu ; Initialising the Tools on your Toolbar ; Adding your own Tools
Assigning Code to Toolbars
Status Bars Creating Status Bars ; Adding a Status Label to the Status Bar
Adding a Progress Bar to your Status Bar
Coding menus and toolbars (8 pages) About this Chapter Our Example – Googlewhacking ; Sharing Code between Menus, Toolbars, Keys and Context Menus
Enabling/Disabling Our Tools and Menus Properties to Determine if Actions are Possible ; A Routine to Conditionally Enable/Disable Menus and Toolbars ; Running our Enabling/Disabling Code
Getting the Actions to Work Creating the Action Routines ; Assigning the Actions to the Toolbar ; Assigning Actions to the Menu
Keyboard Shortcuts
Working with files and folders (10 pages) The Different File and Folder Dialog Boxes
Adding File or Folder Dialog Boxes to a Form Adding Dialog Box Controls Graphically ; Creating and Displaying Dialog Boxes Programmatically
Parts of a File Dialog Box
Customising a File Dialog Box File Filters ; File Extensions ; Allowing Read-Only Files ; Selecting Multiple Files ; Setting and Restoring the Initial Directory ; Checking if Files/Folders Exist ; Checking How to Proceed if Files Exist
Browsing for a Folder
Reading and Writing Files Our Example ; Referencing the System.IO Namespace ; Writing Out a Mortgage Application Line ; Reading in the Mortgage Application File
Debugging and Error Handling (12 pages) Catching Errors Syntax of the Try / Catch Statement ; Our Example for Validating Numbers ; Catching Specific Errors
Reacting to Errors
Debugging Setting (and Unsetting) a Breakpoint ; Starting to Debug ; Changing the Next Executable Line ; Stepping Through Code ; Viewing Variables ; Stopping Debugging
The Immediate and Output Windows Displaying the Windows ; Requesting Current Program Information ; Changing Variable Values while Debugging ; Writing to the Immediate or Output Window ; Useful Debug Commands ; Controlling which Window Debug Goes To
Other Debugging Tools Conditional Breakpoints ; Watching Variables ; The Call Stack
Linking to Databases (4 pages) Choosing a Database Application
Our Example
Data Sources, TableAdapters and DataSets DataSets ; DataSources ; How TableAdapters Work ; Standard Methods for TableAdapters
Data Sources (4 pages) Creating DataSources Starting the Data Source Wizard ; Creating a Connection to the Database ; Choosing Tables and Views
Viewing and Editing Data Sources and Datasets The Data Sources Window ; Editing Datasets
ComboBoxes and ListBoxes (4 pages) ComboBoxes and ListBoxes The Difference between ComboBoxes and ListBoxes ; Creating ComboBoxes or ListBoxes
Data Bound ComboBoxes and ListBoxes Display and Value Members ; Making a Combo Box Data Bound
Sorting a ComboBox or ListBox Starting to Configure the TableAdapter ; Changing the Sort Order of the Query
DataGridViews (10 pages) Introduction to DataGridViews Creating a DataGridView the Easy Way
Creating a DataGridView Manually
Adding, Editing and Deleting Columns
Formatting and Using Styles How Default Styles Work ; Setting an Overall Default Style ; Formatting Alternating Rows a Different Colour ; Setting a Column and Row Heading Style ; Setting Styles for a Specific Column ; Formatting Numbers or Dates
Changing DataGridView Size Making a DataGridView Stretchy ; Making the Last Column of Variable Width ; What Happens when you AutoSize Columns/Rows
Sorting DataGridViews
Disabling Inserting and Deleting
Making DataGridViews Editable (4 pages) Writing Changes to a Database
Checking your TableAdapter has Update Statements Configuring the TableAdapter ; Method 1 – Generate your SQL Update Statements ; Method 2 – Ensure the Statements are Created
Writing Changes to your Database Why Doesn’t My Update Method Work?
Reacting to DataGridView Events (10 pages) Overview of DataGridView Events Useful Standard Event Properties
Typical Event-Driven Tasks Using an Enumeration to Number Columns ; Conditional Formatting ; Setting Default Values for New Records ; Asking for Confirmation when Deleting Rows
Validating Data Entered Validating Row by Row ; Handling Errors by Individual Cell ; Checking Whole Rows ; Showing Error Icons ; Checking Parsing has Worked
The Order of Validation Events
Advanced DataGridView topics (14 pages) The Ultimate C# Application
Adding Buttons to a DataGridView Creating your Button ; Setting Properties for the Button ; Coding your Button
Adding a Bound Combobox Adding the New Dropdown Column ; Linking the New Column to a Table
Getting the DataGridView to Filter Creating the Filter ComboBox ; Hiding the DataGridView Initially ; Adding a Filter to the DataGridView ; The TableAdapter Query Configuration Wizard ; Filtering the DataGridView when the ComboBox Changes
Creating a Single Client Editing Form Creating a Single Record Form ; The BindingNavigator Control ; Attaching Code to the DataGridView Control ; Attaching Code to Load the Single Record Form ; Saving a Record in the Single Record Form
Deploying Applications (2 pages) Publishing Applications
Installing a Published Application

WPF courseware

Here is a list of all of our WPF manual chapters (you can download the ones marked):

Chapter Sections Subsections
Overview of WPF (2 pages) Overview of WPF WPF Compared with Windows Forms ; Related Software ; Types of WPF Application ; Technologies and Principles Underlying WPF
Visual Studio (10 pages) Setting the Default Start-up Page
Creating Appropriate Settings
Creating Projects
Saving and Closing Files and Projects Closing One Window ; Closing All or Nearly All Windows ; Moving Between Windows ; Saving and Closing a Project
Auto-hidden, Docked and Floating Windows Auto-Hidden Windows ; Docked Windows ; Floating Windows
The Four Most Useful Windows Solution Explorer ; Properties Window ; The Toolbox ; Document Outline ; Displaying the Main Windows
Windows Applications (10 pages) Creating a Window
XAML Comments in XAML ; Commenting Out ; XAML Syntax: Self-Closing Tags and Attributes ; XAML Tags and Elements
Using the XAML Editor Scaling Windows ; Splitting the Screen ; Swapping Panes ; Maximising/Minimising Panes
Properties
Customising Windows Setting Window Properties in the Properties Window ; Resizing Windows by Clicking and Dragging ; Setting a Window to Size to Content
Running an Application Changing the Default Window ; Running an Application
Controls (12 pages) Example Using StackPanel
Adding and Naming Controls Adding a Control to a Window ; Naming Controls
The Basic Controls Buttons ; Labels ; TextBlock Controls ; TextBoxes ; Images
Fonts Setting Fonts ; Setting Fonts Globally
Horizontal and Vertical Alignment Aligning Controls within a Container ; Aligning Controls Themselves
Margins and Padding What Margins and Padding Are ; An Example of XAML Margins ; Different Syntaxes for Setting Margins and Padding ; Setting Margins and Alignment in Design View
Borders Simple Control Borders ; Using Border Controls ; Rounded Corners
Selecting controls (4 pages) Our Example – Top Trumps
Document Outline View Viewing the Document Outline Window ; Previewing Items ; Expanding and Collapsing Elements ; Selecting and Changing Multiple Elements
Other Ways to Select Controls Selecting in Design View with the Right Mouse Button ; Selecting in XAML View
Layout Controls (8 pages)

Download this chapter
StackPanel Controls
WrapPanel and UniformGrid Controls WrapPanel Controls ; UniformGrid Controls
Single-Cell Grid and Canvas Controls Single Cell Grids ; Canvas Controls
DockPanel Controls The LastChildFill Property
Controls to Conserve Space ScrollViewer Controls ; TabControl Controls ; ViewBox Controls ; Expander Controls
Two-Dimensional Grids (4 pages) Creating Rows and Column
Sizing Rows and Columns
Displaying Text in Cells Spanning Rows and Columns
Formatting Grids
Coding Window Events (6 pages) Events Some Event Terms
Attaching Code to a WPF Event The Importance of Naming your Control First ; Attaching Code to a Control’s Default Event ; Creating a New Event-Handler for an Event ; Handling an Event with an Existing Routine
Switching from Windows to Code Using the Keyboard ; Using Solution Explorer
Those Strange Event Arguments Argument 1 – The Object that Called the Event ; Argument 2 – The Event Arguments
Running Code on Window Load
Coding in C# (10 pages) Using AutoCompletion Methods and Properties
THIS and ENVIRONMENT Using THIS to Make Typing Easier ; Using ENVIRONMENT to Get Information
Commenting and Uncommenting Code Commenting Out Code
Laying Out Your Code Statements Spanning Multiple Lines ; Indentation of Code ; Using Code Regions
Find and Replace
Handling Syntax Errors Viewing Syntax Errors ; Using the Error List Window ; Showing Line Numbers ; What the Yellow and Green Lines Mean
Displaying Messages The Parts of a Message Box you can Customise
Code Snippets Surrounding Code with a Snippet
Variables and Data Types (16 pages) Why Use Variables?
Declaring Variables Declaring Variables ; Using Modified Hungarian Notation ; Default Values for Variables ; Problems with Declaring Variables within Clauses
Setting Values in Variables Declaring Integer Variables and Adding/Subtracting ; Accumulating Text in String Variables
Variable Data Types Mapping C# Data Types to the CLR Runtime ; A Lazy Person’s Data Types ; Logical Values ; Integers ; Decimal (Floating Point) Numbers ; Strings and Text ; Dates and Times ; Objects
Converting Variables Conversion Using Convert.To ; ToString() – Special Case for String Conversions ; Casting Data Types
Variable Scope
Notes on Working with Specific Data Types Working with Strings ; Escape Characters ; Splitting Strings ; Formatting Dates ; Working with Numbers – Possible Operations
Testing Data Types
Enumerations What are Enumerations, and Why Use Them? ; Declaring Enumerations ; Giving Enumerations Data Type and Values ; Other Examples of Enumerations
Conditions and Loops (6 pages) Conditions Using IF for Conditions ; Using the More Elegant SWITCH statement
Looping in C# Looping Over a Collection/Array ; Looping a Given Number of Times ; Looping While a Condition is True
Breaking Out of Loops
Properties (4 pages) Designing Properties Three Types of Property
Creating Properties Read-Only Property (Product Name) ; Write-Only Property (Results) ; Read-Write Property (Quantity)
Using Properties
Data Structures and Lists (6 pages) Overview Example of List Code
Basic List Commands Creating a List ; Adding Items to a List ; Counting the Items in a List ; Displaying All of the Items in a List (FOR EACH) ; Removing Items from a List
Finding Particular Items in a List The Various Find Methods ; Lambda Expression Syntax for Find Methods ; Getting a Subset of a List – Method 1: Using FindAll ; Getting a Subset of a List – Method 2: Using GetRange
Working with Strings Joining List Items Together ; Splitting Text into a List
Modular Programming (4 pages) What is Modular Code? A Coding Example
Passing Arguments What is an Argument? ; Types of Argument ; Examples of Each Type of Argument
Optional Arguments An Alternative Method: Using Different Signatures
Debugging and Error Handling (10 pages) Catching Errors Syntax of the Try / Catch Statement ; Our Example for Validating Numbers ; Catching Specific Errors
Reacting to Errors
Debugging Setting (and Unsetting) a Breakpoint ; Starting to Debug ; Changing the Next Executable Line ; Stepping Through Code ; Viewing Variable Values ; Stopping Debugging
The Immediate Window Displaying the Window ; Requesting Current Program Information
Other Debugging Tools Conditional Breakpoints ; Watching Variables ; The Call Stack
Line Drawings (6 pages) The Canvas Control
Specifying Colours Specifying Colours and Opacity in the Properties Window ; Specifying Colours in XAML
Line Drawings The Main Types of Line Control ; Rectangles and Ellipses ; Lines ; Polygons and Polylines
Pen Strokes Stroke Thickness and Colour ; Dashed and Dotted Lines ; Line Shapes ; Types of Join
Brushes (10 pages) Overview
Applying a Brush Applying a Brush Using the Properties Window ; Applying a Brush Using XAML
Gradient Brushes in XAML Radial versus Linear Gradients ; Gradient Stops ; Setting Start and End Points (Radial) ; Setting Start and End Points (Linear) ; Filling in the Remainder of Shapes using SpreadMethod
Gradient Brushes using the Properties Window Creating a Gradient Effect ; Adding and Deleting Gradient Stops ; Editing Gradient Stops ; An Alternative: Editing the Brush Directly
Image Brushes Setting an Image Brush ; Stretch Effects ; Tiling Effects ; ViewPorts
Opacity Masks Opacity Masks in XAML View ; Opacity Mask in Properties Window
Transformations and effects (4 pages) Overview of Transformations Types of Transformation ; Grouping Transformations ; Layout versus Render Transforms ; A Practical Example
Bitmap Effects
Styles (10 pages) Overview
Creating Styles Step 1 - Creating a Resources Section ; Step 2 – Add a Style Section ; Step 3 – Add Setters for Each Style ; Changing the Default Font for an Application
Scope of Styles Application-Level Styles ; Window-Level Styles ; Control-Level Styles
Named Styles Creating Named Styles ; Applying a Named Style
Generic Target Types The TargetType Attribute ; Creating and Applying Generic Styles ; Setting Irrelevant Attributes
Style Inheritance Inherited Styles Can Override Properties
Resources (6 pages) What are Resources?
The Resource Hierarchy
Types of Resource Property Resources ; Control Resources ; Data Type Resources
Resource Dictionaries Creating a Resource Dictionary ; Referencing Resource Dictionaries ; The Order of Referencing Matters!
Menus (8 pages) Menu Overview
Creating Menus in the Properties Window or XAML
Customising Menus The Menu Description ; Short-Cut Keys ; Checked and Checkable Menu Items ; Separator Rows
Coding Menus Changing the Border Gradient Colours ; Making Sure the Right Menus are Checked
Context Menus (Right-Mouse Menus) Creating the Context Menu as a Resource ; Using the Context Menu ; The Code Handling the Context Menus
Toolbars (4 pages) Parts of a Toolbar
Our Example Toolbar
Tweaking Toolbar Appearance Controlling Overflow ; Using Separators ; Toolbar Orientation
Simple Binding (8 pages) What is Binding? Technical Terms for Binding Components
Examples of Simple Binding Example: Binding Colours to TextBoxes ; Example: Customising a Rectangle
Binding to Data: ComboBoxes/ListBoxes Using an Array as an Item Source ; Using a List of Strings as an Item Source ; Using Collections (Experienced .NET Coders Only!)
Templates for ListBoxes and ComboBoxes Data for our Example ; Data Templates
Data Context
Binding to databases (12 pages) Our Database Our Example Database: Top Trumps ; The Packs Table ; The Cards Table
DataSets, DataTables and DataAdapters DataSets and DataTables ; TableAdapters
Using Connection Strings Creating an App.Config File ; Editing your App.Config File ; Getting your Connection String in Code ; Adding a Project Reference to System.Configuration
Binding using ADO.NET Setting the Data Context for the Window ; Code to Create the DataSet ; The XAML for the Application
Bound ComboBoxes and ListBoxes
Binding Converters Creating a Converter Class ; Implementing the Converter
DataGrids (12 pages) Overview Advantages of DataGrids over Other Controls
Alternatives to DataGrid Controls Using a ListBox Control ; Using a ListView Control
Basic DataGrids
Manually Specifying Columns Column Widths
Formatting DataGrids Getting Rid of the Extra Row ; Row and Column Headers ; Gridlines and Borders ; Alternating Rows ; Freezing Columns ; Example of Styles and Formats
Sorting DataGrids
Changing Selection Mode Simple or Extended Selection ; Changing the Selection Unit
DataGrid Events Attaching Events to DataGrids ; Getting Information about the Cell/Row/Column
Publishing an Application (2 pages) Publishing or Deploying Applications
Installing a Published Application
Property Triggers (2 pages) Overview of Property Triggers Syntax of a Property Trigger
The Property Triggers for our Examples
Animations and Trigger (10 pages) Our Example
StoryBoards Examples of StoryBoards ; Storyboard Times ; What Happens when Storyboards Finish
Storyboards using Property Triggers EnterActions and ExitActions
Event Triggers and Animations
Stopping, Pausing and Starting Animations An Example of Stopping, Pausing and Resuming Storyboards
Key Frame Animations A Special Case: Animating Strings

Notes:

  1. Since Wise Owl print courseware double-sided to save trees, the number of physical pages in each chapter is roughly half of the number of sides quoted.
  2. Downloads are provided as examples only, and should not be used or distributed in any way or form without the prior written permission of Wise Owl.
This page has 0 threads Add post