RectangleTool editable textbox
Posted: Mon Mar 17, 2008 6:19 pm
if an editable rectangletool is dragged arround the screen with the mouse and a key is pressed the text box that is used for editing the text in the rectangletool is displayed on the screen as a seperate object from the rectangletool.
public void AddAnnotation()
{
Steema.TeeChart.Tools.RectangleTool annotation = new Steema.TeeChart.Tools.RectangleTool();
annotation.KeyDown += new KeyEventHandler(annotation_KeyDown);
annotation.AllowEdit = true;
annotation.Text = "F2 to begin and end edit";
annotation.AutoSize = true;
annotation.AllowResize = true;
annotation.Click += new MouseEventHandler(annotation_Click);
this.uxChart.Tools.Add(annotation);
AdjustRectanglesPosition(uxChart, annotation, false);
}
void annotation_KeyDown(object sender, KeyEventArgs e)
{
//if enter key is pressed then exit annotation editing
if ((e.KeyCode == Keys.Enter || e.KeyCode == Keys.F2) && currentAnnotationTool != null)
currentAnnotationTool.EndEdit();
}
void annotation_Click(object sender, MouseEventArgs e)
{
annotationSelected = true;
currentAnnotationTool = (Steema.TeeChart.Tools.RectangleTool)sender;
}
public void AddAnnotation()
{
Steema.TeeChart.Tools.RectangleTool annotation = new Steema.TeeChart.Tools.RectangleTool();
annotation.KeyDown += new KeyEventHandler(annotation_KeyDown);
annotation.AllowEdit = true;
annotation.Text = "F2 to begin and end edit";
annotation.AutoSize = true;
annotation.AllowResize = true;
annotation.Click += new MouseEventHandler(annotation_Click);
this.uxChart.Tools.Add(annotation);
AdjustRectanglesPosition(uxChart, annotation, false);
}
void annotation_KeyDown(object sender, KeyEventArgs e)
{
//if enter key is pressed then exit annotation editing
if ((e.KeyCode == Keys.Enter || e.KeyCode == Keys.F2) && currentAnnotationTool != null)
currentAnnotationTool.EndEdit();
}
void annotation_Click(object sender, MouseEventArgs e)
{
annotationSelected = true;
currentAnnotationTool = (Steema.TeeChart.Tools.RectangleTool)sender;
}