It's a new feature that is added on Automate API cTrader version 4.3 that allows you to easily show a dialog popup message box, it's very similar to a WPF message box if you used it then you will be able to easily use the Automate API message box.
Why Should I Use It?¶
You might be wondering when you can use WinForms or WPF why there is a need for an additional message box feature, it differs from WinForms and WPF because:
- It uses the cTrader design and theme color
- It doesn't require full access rights
- It's much easier to use it than WinForms or WPF
To use MessageBox you just have to call it's
Show method and pass the parameters for text, title, buttons, icons, and default value:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Show method has multiple overloads that you can use based on your need, for more please check the MessageBox references page.
Build and run the above cBot, you should see:
If you click any of the buttons you will see the button name on the logs tab.
You can use MessageBox anywhere on your cBot / Indicator, when you call
Show method it will not return until you click any of the message box buttons, during this time all other events of your cBot / Indicator will be invoked normally.