How can I get the Alert box in CBot?

Created at 24 Mar 2021, 08:51
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AN

anikaurmi420

Joined 18.10.2020

How can I get the Alert box in CBot?
24 Mar 2021, 08:51


How can I get the Alert box in CBot?

Something like this :--  Alert("Hello World");


@anikaurmi420
Replies

amusleh
24 Mar 2021, 09:23

There are different ways to show a popup message box, the simplest option is to use WinForms dialogs:

MessageBox.Show("Some text", "Some title", 
    MessageBoxButtons.OK, MessageBoxIcon.Error);

The MessageBox is inside System.Windows.Forms, so you have to reference that assembly for the above code to work.

If you need something more advanced you can use the open source ctrader-alert_popup library.


@amusleh

anikaurmi420
24 Mar 2021, 10:21

RE:

amusleh said:

There are different ways to show a popup message box, the simplest option is to use WinForms dialogs:

MessageBox.Show("Some text", "Some title", 
    MessageBoxButtons.OK, MessageBoxIcon.Error);

The MessageBox is inside System.Windows.Forms, so you have to reference that assembly for the above code to work.

If you need something more advanced you can use the open source ctrader-alert_popup library.

Thanks, amusleh.


@anikaurmi420