void elm_MouseClick(object sender, EventArgs e) { if (m_Balloon != null) { m_Balloon.FadeOut(); m_Balloon = null; } var elm = sender as CandleElement; if (elm == null) { return; } var target = new Point(elm.DisplayRegion.Left + BAR_WIDTH / 2, elm.DisplayRegion.Top - 1); target = elm.Host.PointToScreen(target); var c = elm.Candle; var body = new Rectangle(target.X - 100, target.Y - 128, 200, 100); m_Balloon = new Balloon(body, target, Color.FromArgb(200, 255, 255, 50)); m_Balloon.Deactivate += (s, _) => { DisposableObject.DisposeAndNull(ref m_Balloon); }; m_Balloon.Text = @"{0} {1} sec Open: {2} Close: {3} Hi: {4} Low: {5} Buy: {6} Sell: {7} ".Args(c.TimeStamp, c.TimeSpanMs / 1000, c.OpenPrice, c.ClosePrice, c.LowPrice, c.HighPrice, c.BuyVolume, c.SellVolume); m_Balloon.DisposeOnFadeOut = true; m_Balloon.FadeIn(); }
private void button4_Click(object sender, EventArgs e) { balloon.FadeOut(); }