background

Tradematic Support Center

Guides, articles, videos and links for Tradematic users and developers.

Отображение всплывающего сообщения в системном трее Windows

15083РЕДАКТОР КОДА ВСПЛЫВАЮЩЕЕ СООБЩЕНИЕ ТРЕЙ WINDOWS

Следующий код позволяет работать со всплывающими сообщениями в системно трее Windows

// Отображение всплывающего сообщения в системном трее Windows
// Запускать в конце исполнения скрипта стратегии, чтобы не мешать сигналам
using System.Drawing;
using System.Windows.Forms;
using System.Threading;

private void ShowPopup(string text)
{
NotifyIcon notifyIcon;
notifyIcon = new NotifyIcon(new System.ComponentModel.Container());
notifyIcon.Icon = new Icon("briefcase.ico"); // стандартная иконка Tradematic
notifyIcon.Visible = true;
notifyIcon.ShowBalloonTip(10000, "Tradematic", text, ToolTipIcon.Warning);
System.Media.SystemSounds.Hand.Play();
Thread.Sleep(3000);
notifyIcon.Visible = false;
notifyIcon.Icon.Dispose();
notifyIcon.Dispose();
}
This website uses cookies. By continuing to use this website, you consent to our Privacy Policy. OK