making a pop up form for touch screen use.
what am i missing to get the "pocket1" result to work on the button press..
CS0103 | in line: 39 | error text: The name 'pocket1' does not exist in the current context
the first bit works fine and populates my button text with the right number taken from a screen text field.
string content1 = AS3.Getfield(20401);
double pocket1 = Convert.ToDouble(content1);
pocket1 = (int)pocket1;
Button MyButton = new Button();
MyButton.Size = new System.Drawing.Size(80, 40);
MyButton.Location = new System.Drawing.Point(10, 100);
MyButton.Text = ("POCKET 1 T "+pocket1);
MyButton.Click += new EventHandler (MyButton_Click);
MyForm = new Form();
MyForm.Size = new System.Drawing.Size(430, 400);
MyForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
MyForm.Controls.Add(MyButton);
MyForm.ShowDialog(exec.mainform);
#Events
Form MyForm; //This is a global variable, a Windows Form
void MyButton_Click(object sender, EventArgs e)
{
//exec.Code("M6 T"+pocket1);// *************************************************************************** errors here.!
exec.Code("M6 T"+1);//********** but this works
MyForm.Close();
}