help
Root Question Message
scorelbl
in the designer (no capitals)?Snek()
is the constructor method for the class. scorelbl
should be accessible anywhere within the classForm1
class. Can you post your code for Form1
?scorelbl
is in the same class as Snek
. Do you see the file named Snek.designer.cs
?namespace Snek
{
partial class Snek
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}
*.designer.cs
file is autogenerated from the controls you add in the design view. In the file there should be a definition like Label scorelbl = new Label();
but that is absent from this filebtnPlay
or playBtn
Button
gameTimer
Timer