Announcement

Collapse
No announcement yet.

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:	286
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.


    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:



        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 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
        553 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