カウントダウンするタイマーを画面に表示させる方法

UiPath Studio Community Edition 23.8.1版を利用中の者です。

30秒から1秒ずつカウントダウンするタイマーを作成してみました。(添付画像参照)
本当はウインドウかメッセージボックスで"残り秒数: " + int_timeRemaining.ToString + “秒”
を表示させたかったのですが、やり方が分かりませんでした。
UiPathでは難しいでしょうか。

Hi @gorby

Try the below way:

Assign-> int_timeRemaining = 30                   (DataType: System.Int32)
While
     Condition: int_timeRemaining > 0
  Log Message: "Seconds remaining: " + int_timeRemaining.ToString + " seconds"
  Assign -> int_timeRemaining = int_timeRemaining - 1
  Dalay-> TimeSpan.FromSeconds(1)
End While

Message Box: "Countdown finished!"

Instead of passing the count in variables panel assign it using Assign activity.

Check the below image for better understanding.


Regards

Hi I do not think you understand my intention…
I am asking if message box could show the following message per each second.

“Seconds remaining: 30 seconds”
“Seconds remaining: 29 seconds”
“Seconds remaining: 28 seconds”
.
.
Do you think it is possible using UiPath?

Hi @gorby

It’s possible for Message box.

Regards

If you think so,will you show me how to remove “OK” button from message box?

Hi @gorby

In UiPath, the Message Box activity by default includes an “OK” button, which allows the user to acknowledge the message. If you want to display a message without the “OK” button, you can use a different method to show the message, such as writing it to the Output panel or logging it to a file.

or pass the syntax in Delay Activity directly in Message Box. i.e. TimeSpan.FromSeconds(1). Below image will give you better understanding.

This will also help you from avoid clicking or press Enter for Ok button.

Regards

Regards

こんにちは

おそらく非同期に処理したほうが良いのでカスタムアクティビティを使用できるなら、それを使った方が良いと思います。例えばUiPathTeam.Interactive Activitesなどが利用できます。

あるいはUiPath Assistantの画面での表示ならReportStatusアクティビティも使えます。

以下サンプルです。(上記の2つを同梱しています)
Sample20240217-1.zip (4.5 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.