Pause execution of a method without locking GUI. C#

前端 未结 4 1620
孤街浪徒
孤街浪徒 2020-12-30 16:19

I\'m working on a card game in C# for a project on my Intro to OOP paper and have got the game working now but am adding \"flair\" to the GUI.

Currently cards are de

4条回答
  •  北海茫月
    2020-12-30 16:38

    The cheap way out would be to loop with calls to Application.DoEvents() but a better alternative would be to set a System.Windows.Forms.Timer which you would stop after the first time it elapses. In either case you'll need some indicator to tell your UI event handlers to ignore input. You could even just use the timer.Enabled property for this purpose if it's simple enough.

提交回复
热议问题