Displaying Windows Forms inside unit test methods

后端 未结 2 1803
一向
一向 2021-01-12 19:00

I just discovered unit test projects in Visual Studio .NET and am using test methods to set up examples of global code I have developed.

Some global methods involve

2条回答
  •  半阙折子戏
    2021-01-12 19:34

    I had the same issue. The dialog was blinking visible then disappearing. It was already TopMost, and I tried the other trick of setting it to visible then not visible before showdialog was called, but nothing worked.

    Then I checked the other dialog that was working fine and it had ControlBox = true. I tried that, and it worked!

    This is definitely applicable to the question.

提交回复
热议问题