Code: Select all
g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width,rect.Height)
However, after installing the latest (TeeChartNET2010VSNET2010_4.1.2011.04193) TChart it started to draw a rectangle from the mouse position to the topleft corner. Dragging the mouse down and right, I could drag the topleft of the rectangle down and right. In the debugger rect.Width and rect.Height typical would have the values 1 and 1 at the start of drawing.
I have now replaced the code with the following:
Code: Select all
g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width + rect.X, rect.Height+rect.Y)
This is the current AfterDraw:
Code: Select all
Private Sub TChart2_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart2.AfterDraw
Dim rect As Rectangle = gCurrentSelection
'g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width,rect.Height)
g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width + rect.X, rect.Y + rect.Height)
End Sub