Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Button with Geometry Path

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

    Button with Geometry Path

    Hello,

    I need to add in the ChartWindow menu a button with the same style as the standard buttons (and especially the DropShadow effect).



    If the button contains a text, then the style is "inherited" without me doing anything, and the button has the shadow effect when the pointer passes over the button.



    However, if the button contains a geometry path, to display an icon, then the button does not appear.
    The only solution I found was overriding the style, but then the standard dropshadow effect is lost.



    Please, could you provide a simple example to work the dropshadow effect on a button with a geometry path?

    Thanks in advance
    Attached Files

    #2
    Hello cls71,

    The reason the existing icons and text have a drop shadow is that they are actually one in the same. The Icons pictured are a string and the font used in the platform creates the Icon. The style of the Label that holds the Buttons text content creates the effect you see.

    A Path would change the content type of the button from Text to a Control so a label is no longer used, you would likely need to create your own DropShadowEffect and append it to your Path or button if you want the Path specifically to have a drop shadow.

    You can find examples of existing XAML shadows used in the platform in the Skin files in case you are creating xaml elements, specifically the Documents\NinjaTrader 8\templates\Skins\Slate Light\BluePrint.XAML file. You can search for Shadow to locate them.

    If you are instead creating the item programmatically, you would likely need to use a process like the following: http://stackoverflow.com/questions/4...om-code-behind

    If you can provide a simple example of how you are adding the item currently, I may be able to provide more details on how to add the drop shadow, it would depend if you are adding a XAML item or through the code on how you would need to append the style. You could also find more detailed examples of WPF concepts like dropshadow usage using Google and utilizing WPF specific tutorials.


    I look forward to being of further assistance.

    Comment


      #3
      Thanks Jesse,

      I already knew those help resources. I finally solved it by applying a standard style.



      Code:
      btnImport.Style = Application.Current.TryFindResource("LinkButtonStyle") as Style;
      btnImport.Cursor = Cursors.Arrow;
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X