Annotation Control
Posted: Tue Jul 21, 2009 8:34 pm
Is it possible to add a control to annotation?
Thanks,
Sachin
Thanks,
Sachin
Steema Software - Customer Support Forums
http://teechart.com/support/
Is not possible to add a control to annotation tool.Is it possible to add a control to annotation?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Dock = DockStyle.Fill;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
tChart1.Click += new EventHandler(tChart1_Click);
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
}
Panel myPanel;
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (myPanel != null)
{
myPanel.Dispose();
}
myPanel = new Panel();
tChart1.Controls.Add(myPanel);
myPanel.Location = new Point(e.X, e.Y);
Label myLabel = new Label();
myLabel.Text = "This is the text I want to use";
myPanel.Controls.Add(myLabel);
Button yesBtn = new Button();
yesBtn.Location = new Point(10, 20);
yesBtn.Text = "Yes";
myPanel.Controls.Add(yesBtn);
}
void tChart1_Click(object sender, EventArgs e)
{
DialogResult reply = MessageBox.Show(tChart1, "Tap either Yes or No", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if ((reply == DialogResult.Yes))
{
// Process Yes
}
else
{
// Process No
}
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line line1;
int MouseX, MouseY;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Dock = DockStyle.Fill;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
line1.Pointer.Visible = true;
MouseX = 0;
MouseY = 0;
tChart1.Click += new EventHandler(tChart1_Click);
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.Line(line1.CalcXPos(5), line1.CalcYPos(5), MouseX, MouseY);
}
Panel myPanel;
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (myPanel != null)
{
myPanel.Dispose();
}
myPanel = new Panel();
tChart1.Controls.Add(myPanel);
myPanel.Location = new Point(e.X, e.Y);
Label myLabel = new Label();
myLabel.Text = "This is the text I want to use";
myPanel.Controls.Add(myLabel);
Button yesBtn = new Button();
yesBtn.Location = new Point(10, 20);
yesBtn.Text = "Yes";
myPanel.Controls.Add(yesBtn);
MouseX = e.X;
MouseY = e.Y;
tChart1.Refresh();
}
void tChart1_Click(object sender, EventArgs e)
{
DialogResult reply = MessageBox.Show(tChart1, "Tap either Yes or No", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if ((reply == DialogResult.Yes))
{
// Process Yes
}
else
{
// Process No
}
}