Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Make Custom Drawing Tool Icon Turn White on Hover?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Make Custom Drawing Tool Icon Turn White on Hover?

    Hi all,
    I'm creating a custom drawing tools with an Icon property using a Grid and Path (Fill set to FontActionBrush or a static color).
    Native tools turn white on hover with a bluish background, but my custom icon only gets the background, not the white fill.
    How can I make my icon dynamically turn white on hover like native tools, especially across light and dark skins? Is there a specific resource or style I should use?
    Thanks!

    My example code:
    public override object Icon
    {
    get
    {
    Grid myCanvas = new Grid { Height = 16, Width = 16 }; System.Windows.Shapes.Path p = new System.Windows.Shapes.Path(); p.Fill = Application.Current.FindResource("FontActionBrush" ) as System.Windows.Media.Brush ?? Brushes.CornflowerBlue; p.Data = System.Windows.Media.Geometry.Parse("M7,2 H4.2 V0.5 H11.5 V2 H8.5 V4 H10.7 V5.5 H8.5 V7.4 H10.6 V8.9 H8.5 V10.8 H10.6 V12.3 H8.5 V14.2 H11.5 V15.7 H4.2 V14.2 H7 V12.3 H4.9 V10.8 H7 V8.9 H4.9 V7.4 H7 V5.5 H4.9 V4 H7 V2 Z"); myCanvas.Children.Add(p); return myCanvas;
    }
    }

    Regards
    Jan
    ekedal.no

    #2
    Hello Jan,

    This is an advanced C# concept.

    There can be limitations using unsupported code and advanced C# concepts in a NinjaScript, so your mileage may vary. As of now, we do not have any examples that can be used to navigate that path.

    This thread will remain open for any community members that would like to provide direction or a custom sample of this advanced c# concept.
    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    52 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    16 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X