Jump to content

Trouble with C# book’s chapter 4 exercise titled "Building a Typing Game"

dchudik's Photo
Posted Dec 26 2010 09:01 PM
2201 Views

I went through this chapter 4 (page 160) exercise in Head First C# 2 times and yet the form did not respond to my key strokes. I am not sure what I missed however I did note that the keydown event developed in the exercise was on the form and not the listbox1. I created a keydown event for the listbox and put a messagebox in it which showed me that the keystrokes were captured every time inside that control. How is it that your exercise was expecting the form’s keydown event to fire when the focus is on the listbox? Maybe I missed something. Thanks in advance for an answer.

Tags:
0 Subscribe


1 Reply

0
  Paul-S_1034's Photo
Posted Jan 16 2011 06:53 PM

I too had problems with the Typing Game similar to yours so i downloaded the working program from the web site http://www.stellman-greene.com It`s in the book.
I found the code to be ok but some differences in the properties:-

listBox1 selection mode change to None

Form1 keyPreview change to True

difficultyProgressBar maximum change to 701

timer1 enabled change to True

Good Luck Hope this helps
Paul-S