How to Process After ShowDialog

Asked 1 years ago, Updated 1 years ago, 336 views

In powershell, click
If you do $form.ShowDialog(), the process will stop completely.
How do I process Write-Host "hoge" one second after ShowDialog?
Shall we?

When I used Show() instead of ShowDialog, the form window froze.

·What you want to do
Show the main form and display hoge on the console after 1 second.

powershell

2023-01-08 22:29

1 Answers

In particular, WinForms recommends that you implement it with C# before porting it to PowerShell instead of trying and trying PowerShell out of the blue.

Form.Show() and Form.ShowDialog() are mentioned in this question, but if implemented with C#, the Main() method in Program.cs will be

Application.Run(newForm1());

You should be aware that PowerShell also needs to write the corresponding action, and you should be able to understand that this line does not return the form until it is closed.

Show the main form and display hoge on the console after 1 second.

As mentioned above, you will need to print using one of the methods in the form.


2023-01-09 04:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.