1
Reply

btn_click

Jeffrey Wanner

Jeffrey Wanner

Jul 24 2008 11:43 AM
2.9k

Need some help with an event. Im in the process of writing a program that sends data to a usb port for a motor controler. Im stuck in a situation where I want to pause the program using a button from within a for loop, evewrything I do I end up with this. Error 1 Operator '!' cannot be applied to operand of type 'System.Windows.Forms.Button' 

here is the code sample I have.

for (int stpnt = DataArray[1]; stpnt > DataArray[0]; stpnt--)

{

lblAddress.Text = Convert.ToString(stpnt);

lblSndDta.Text = Convert.ToString(DataArray[3]);

pgbProgress.Value = 0;

btnPause.Text = "Pause";

for (int x = 0; x < DataArray[2]; x++)

{

while (!btnPause)

{

// Insert the pause program button here

pgbProgress.Value = x;

this.Refresh();

}

btnPause.Text = "Unpause";

}

}

is there a way "besides creating a new event" that I can use the button within a for loop

electroteck


Answers (1)