• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

QuantityUpDown: how to let write related text near contol?

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

    QuantityUpDown: how to let write related text near contol?

    Hello.

    I am often use QuantityUpDown: it is very useful.

    When I trying to add it on ToolBar, or in NTMenuItem I can see only control - no any text tag around.

    If I set Content property - I can't see control but can see this content string.

    So, how to put some text near control (on the left or on the right) and leave control visible and accessible on toolbar and on menus ?

    And have another question: how to set fixed number of digits of shown value?
    ContentStringFormat= "000";
    not work (which is obvious after first question).
    Attached Files
    Last edited by fx.practic; 07-22-2018, 05:55 AM.

    #2
    Hello fx.practic,

    Thank you for your note.

    I would suggest downloading the Addon framework at the following link,
    https://ninjatrader.com/support/help...don_window.htm

    In this sample you’ll see that above the QuantityUpDown control there is TextBlock which acts as a label, “quantity”. You could add a TextBlock next to the QuantityUpDown control.

    To format a value to a specific number of digits you could use,
    Code:
    Double thisNumber = 1.050505;
    Print(thisNumber.ToString("0.00000")); //Will print 5 decimals even if they are all zeros
    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for clear answer about QuantityUpDown essence, Alan.

      But, under formatting string I mean if I can format exactly QuantityUpDown values?
      For example, to see always 3 digits: 001, 002, 013...
      Last edited by fx.practic; 07-23-2018, 05:06 AM.

      Comment


        #4
        Hello fx.practic,

        It would not be possible to modify the QuantityUpDown control, which is probably an int and can't take decimals. I will put in a feature request to be allowed to modify the format.

        You would have to create your own control. I'm unaware of any existing samples which demonstrate how this could be done and this would be out of the scope of what we can support.

        I would suggest searching the net for creating custom updown control in C#, Visual Studio, XAML.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Ok, that's clear now. Thank You.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jamarc, Today, 02:30 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by uday12, Yesterday, 04:19 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by grose, Today, 06:53 AM
          2 responses
          7 views
          0 likes
          Last Post grose
          by grose
           
          Started by Bobisam, Yesterday, 04:57 PM
          1 response
          21 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by voltlon, Yesterday, 05:18 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X