Hi all,
I'm following this tutorial and I'm encountering strange behaviour with the program.
My finishLabel ought to be calling finishLabel_MouseEnter() when the mouse hovers over it, but it's calling wall_MouseEnter() instead - the location of the mouse resets and the congratulations box doesn't show up. In the properties/events box for the label, finishLabel_MouseEvent is selected. In Form1.Designer.cs,
`// `
`// finishLabel`
`// `
`this.finishLabel.AutoSize = true;`
`this.finishLabel.Location = new System.Drawing.Point(467, 430);`
`this.finishLabel.Name = "finishLabel";`
`this.finishLabel.Size = new System.Drawing.Size(34, 13);`
`this.finishLabel.TabIndex = 15;`
`this.finishLabel.Text = "Finish";`
`this.finishLabel.MouseEnter += new System.EventHandler(this.finishLabel_MouseEnter);`
describes my finishLabel, and there are no other 'this.finishLabel.MouseEnter' lines.
In Form1.cs,
`private void finishLabel_MouseEnter(object sender, EventArgs e)`
` {`
` // Show a congratulatory MessageBox, then close the form.`
` MessageBox.Show("Congratulations!");`
` Close();`
` }`
describes how the method should be working.
I tried changing the event box selection back and forth between the two available events, and restarting the IDE (Visual Studio 2012 Express for Desktop) in case it was an error there, but regardless of how I run the program the finishLabel behaves incorrectly.
Any ideas on what the problem might be?
Thanks in advance,
Devon