TeeChart Paint Event is Not Firing
Posted: Wed Jun 29, 2016 12:16 pm
Hi,
We are not getting TeeChart's Paint Event on Runtime. For other controls Paint event is getting called successfully.
Following is the code snippet:
We are not getting TeeChart's Paint Event on Runtime. For other controls Paint event is getting called successfully.
Following is the code snippet:
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SampleTChart
{
public partial class Form1 : Form
{
Point MouseLocation;
public Form1()
{
InitializeComponent();
}
private void tChart1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(Pens.Red, new Point(0, MouseLocation.Y), new Point(Width, MouseLocation.Y));
e.Graphics.DrawLine(Pens.Black, new Point(MouseLocation.X, 0), new Point(MouseLocation.X, Height));
}
private void tChart1_MouseMove(object sender, MouseEventArgs e)
{
MouseLocation = e.Location;
tChart1.Invalidate(); //or tChart1.Draw();
}
}
}