Here the below code enables the particular bit as high in parallel port.How to set time interval for the button click in windows form.If i set the time interval to 2 seconds the timer should start then 2 seconds after that it should stop automatically.
private void button1_Click(object sender, EventArgs e)
{
PortAccess.Output(888,1);
}
can u please let me know any suggestion or example to do this.Inside this button_click.
So you just want to clear the bit 2 seconds later? Something like this should work:
You may find it simpler to set up the timer just once, and store it as an instance variable. Then you could attach the
Tickevent and set the interval on construction, and add it to the components of the form so that it’s automatically disposed. Your methods would then be: