I also have a button to turn the mouse color on and the mouse color to transparent.
Sometimes it works and other times it does not work. Is there residual memory that keeps the lines continously drawing?
here is some of the code.
private void OnMouseDownEvent(object sender, MouseEventArgs e)
{
int xIndex = GetBarIndexFromX(e.X);
if (bShowMarkerLine == true)
{
DrawVerticalLine("VLine", CurrentBar - xIndex, VLineColor);
}
}
private void btnBlank_Click(object sender, EventArgs e)
{
if (btnBlank.Text == "Disable Vertical Line")
{
btnBlank.Text = "Disabled";
VLineColor = Color.Transparent;
RemoveDrawObject("VLine");
}
else
{
btnBlank.Text = "Disable Vertical Line";
VLineColor = Color.Blue;
}
bUpdate = true;
Update();
}
here is the button click event that suppose to change the color to transparent.
private void btnBlank_Click(object sender, EventArgs e)
{
if (btnBlank.Text == "Disable Vertical Line")
{
btnBlank.Text = "Disabled";
VLineColor = Color.Transparent;
RemoveDrawObject("VLine");
bShowMarkerLine = false;
}
else
{
btnBlank.Text = "Disable Vertical Line";
VLineColor = Color.Blue;
bShowMarkerLine = true;
}
bUpdate = true;
Update();
}
If i restart it works but if i change times it has residue memory
Comment