When I use mouse click I can get the the x and y values, but I want to place those values in a new parameter. For some reason it will not allow me. Here is the code.
private void btnRay_Click(object sender, EventArgs e)
{
SendKeys.SendWait("{F3}");
Print("Ray Anchors Reset"); // wierd thing is Ray Anchors Reset shows but the printed bool value will not
bStartAnchor= true;
Print(bStartAnchor.ToString());
}
//second section
protected void MouseClicked(object sender, MouseButtonEventArgs e)
{
// convert e.GetPosition for different dpi settings
clickPoint.X = ChartingExtensions.ConvertToHorizontalPixels(e.Get Position(ChartPanel as IInputElement).X, ChartControl.PresentationSource);
clickPoint.Y = ChartingExtensions.ConvertToVerticalPixels(e.GetPo sition(ChartPanel as IInputElement).Y, ChartControl.PresentationSource);
convertedPrice = Instrument.MasterInstrument.RoundToTickSize(chartS cale.GetValueByY((float)clickPoint.Y));
convertedTime = ChartControl.GetTimeBySlotIndex((int)ChartControl. GetSlotIndexByX((int)clickPoint.X));
Print(convertedPrice); // Converted price and Time will display
Print(convertedTime);
Print("^^^^^^^^^^^^^^^^^");
Print(bStartAnchor);
startconvertedPrice =convertedPrice;
startconvertedTime = convertedTime;
if(bStartAnchor == true) // anchor never changed to true
{
Print(startconvertedPrice); // will not display
Print(startconvertedTime);
bStartAnchor = false;
}
}
EVEN when the flag is changed to true from the button ray it never does? I need the start and the end anchor points I will need anchor points everytime a Draw and object. The objects I am drawing are rays, horizontal lines rectangles etc.

Comment