#region Crosshair Color Management
private void UpdateCrosshairColor() { if (ChartControl == null) return; if (noHotkeyTrading && tradingFromChart) { // Set crosshair to red when no hotkey trading is enabled if (!crosshairColorChanged) { originalCrosshairColor = ChartControl.Properties.ChartText; crosshairColorChanged = true; } ChartControl.Properties.ChartText = Brushes.Red; } else { // Set crosshair to dim gray when disabled or restore original if (tradingFromChart && !noHotkeyTrading) { ChartControl.Properties.ChartText = Brushes.LightGray; } else { // Restore original color when trading is completely off RestoreOriginalCrosshairColor(); } } // Force chart to redraw crosshair ChartControl.InvalidateVisual(); } private void RestoreOriginalCrosshairColor() { if (ChartControl != null && crosshairColorChanged && originalCrosshairColor != null) { ChartControl.Properties.ChartText = originalCrosshairColor; ChartControl.InvalidateVisual(); } } #endregion
Im trying to change the crosshair lines color when a button is enable. I can make it work with ChartControlProperties.CrosshairLabelBackground or ChartText to change labels or text color, but when i try to replace it with CrosshairStroke is not working and get a lot of compile errors