首页  编辑  

避免用户重复点击按钮

Tags: /C#/其他技巧/   Date Created:

//

//

//

private void button1_Click( object sender , EventArgs e)

{

   button1 . Enabled = false ;

    Thread . Sleep( 2000 );

   richTextBox1 . AppendText( Environment . TickCount . ToString() + "\r\n" );

    Application . DoEvents(); //

   button1 . Enabled = true ;

}