CST1620 C# Programming

Week 3

We cover chapter 4 in the book - Making Decisions.
To reiterate from last week, the book uses Windows Forms for creating a GUI throughout the book.
However, we will also focus on using WPF (Windows Presentation Foundation), which is a newer, more flexible way to create a GUI.

Watch this YouTube video on creating a WPF GUI using several different controls using StackPanels and Grids.
C# WPF UI Tutorials: 01 - The Basics 55:46
C# WPF UI Tutorials: 01 - The Basics - no ads

Watch the class lecture recording for the week. We do the in class exercise in the recording.


In class exercise:

Chapter 4 Exercise 8 RockPaperScissors (in class exercise)
Example using WinForms
Example using WPF utilizing StackPanels and Grids

Images needed to do in class exercise. RPSimages.zip


Homework Labs:


Lab Chap 4 Ex 8 RockPaperScissorWPF - due in one week

This was the in class exercise. Turn in what we did in class.

Submit three things to the D2L dropbox for this lab:
1) Screenshot of your running program with data. Make sure you capture your entire desktop.
2) Screenshot of as much of your code as possible.
3) The entire solution folder as a ZIP file. This folder should contain your entire project and solution.


Lab Chap 4 Ex 7 Guess100WPF - due in one week

Write a GUI program named Guess100WPF that generates a random number between 1 and 100 inclusive. Ask a user to guess the random number, then display the random number and a message indicating whether the user's guess was too high, too low, or correct.

Note: that this is a variation of the problem in the book. Please run the example to see how the program is supposed to work. Some of the changes/additions are:

Note: This program UI is to be created using Windows Presentation Foundation and making use of StackPanels and Grids.

My example (pre WPF) - Guess100.exe

Submit three things to the D2L dropbox for this lab:
1) Screenshot of your running program with data. Make sure you capture your entire desktop.
2) Screenshot of as much of your code as possible.
3) The entire solution folder as a ZIP file. This folder should contain your entire project and solution.