-  [JOIN IRC!]


[Return]
Posting mode: Reply
Name
Subject   (reply to 684)
Message
File
Password  (for post and file deletion)
¯\(°_O)/¯
  • Supported file types are: BMP, GIF, JPG, PNG
  • Maximum file size allowed is 10000 KB.
  • Images greater than 400x400 pixels will be thumbnailed.
  • Currently 317 unique user posts. View catalog

  • Blotter updated: 2015-09-02 Show/Hide Show All


File 141618392944.jpg - (308.05KB , 1200x1600 , 1.jpg )
684 No. 684
I'm working on a Windows Forms Application to run a Pomodoro Timer window. I'm trying to work out why I'm getting this error thrown, here's the deets:
In Form.Designer I have a label that displays label1.Text="Circuit "+ circuitCounter + " Session " + sessionCounter;
circuitCounter and sessionCounter are declared above the initializer but still within the Form1 class.
I'm thrown the error "The variable 'circuitCounter' is either undeclared or was never assigned" and I can't understand why.
Here is the relevant code for the Form1 class:
namespace Pomodoro_Timer
{
public partial class Form1 : Form
{
//set timers
static System.Timers.Timer sessionTimer= new System.Timers.Timer (1500000);
static System.Timers.Timer sbTimer = new System.Timers.Timer(300000);
static System.Timers.Timer lbTimer = new System.Timers.Timer(900000);

//declare counters
public int sessionCounter = 0;
public int sbCounter = 0;
public int circuitCounter = 0;

public Form1()
{
InitializeComponent();
}
And here is the relevant code from the designer:
//
// circuitsessionDisplay
//
this.circuitsessionDisplay.AutoSize = true;
this.circuitsessionDisplay.Location = new System.Drawing.Point(13, 43);
this.circuitsessionDisplay.Name = "circuitsessionDisplay";
this.circuitsessionDisplay.Size = new System.Drawing.Size(82, 13);
this.circuitsessionDisplay.TabIndex = 2;
this.circuitsessionDisplay.Text = "Circuit "+ circuitCounter + " Session " + sessionCounter;


Delete post []
Password  
Report post
Reason