Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Shrinking the width size of a button (AddonShellNoTabs Example)

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

    Shrinking the width size of a button (AddonShellNoTabs Example)

    I am trying to reduce the width of the example button of the example addon.

    Code:
    <Button x:Name="ExampleButton" Grid.Column="1" Grid.Row="2" Content="E B" HorizontalAlignment="Left" VerticalAlignment="Center" Width="25"/>
    but it does not reduce from a width of 85...
    i removed the content value to a single letter to see if was the width of the content but no.
    my guess is that the following line in the xaml file is the responsible for the odd behavior.
    Code:
    xmlns:t="clr-namespace:NinjaTrader.Gui.Tools;assembly=NinjaTrader.Gui"
    the screenshots are one with width of 25 and the oder with width of 250
    any suggestion?? Thank you very much!!!
    FVJ

    Click image for larger version

Name:	Buttons width.JPG
Views:	202
Size:	37.5 KB
ID:	1181420
    Attached Files

    #2
    Hello efeuvejota01,

    You may be able to use MaxWidth however there are other platform styles being applied to the button and the textbox that gets used for the content when using a string. To be able to fully control the properties of a WPF control you would have to set its style to null. The alternative would be to experiment with the Padding, Margin, Width and MaxWidth properties to see if you can find a look which allows the existing theme to display the fixed text smaller without clipping it.


    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse!!!
      I have another question
      how do I
      set its style to null.
      ???
      Thank you very much!!

      Comment


        #4
        Hello efeuvejota01,

        You can use the x:Null in xaml:



        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        3 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        8 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X