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

How to add Windows.Forms control to UserControlCollection() ?

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

    How to add Windows.Forms control to UserControlCollection() ?

    Hello.

    I tried to put on chart food-looking diagram using System.Windows.Forms.DataVisualization.Charting.Ch art control.
    After some failed attempts, I simplified my task and decided to add just Windows.Form.Labels using a WindowsFormsHost container.
    Labels remained invisible too, and I found information that issue may be
    PHP Code:
    Window.AllowsTransparency true
    which I was unable to change grammatically to false.
    https://social.msdn.microsoft.com/Fo...rary?forum=wpf

    Can you, please, give some advice?
    Maybe there is another control for a simple statistical diagram?

    Thank You.
    Last edited by fx.practic; 07-17-2019, 03:13 PM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Windows Forms is no longer being used in NinjaTrader. NT8 now uses WPF/Xaml for its window framework. If you have located a Windows.Forms sample for a concept, I would suggest looking for an alternative WPF version instead.

    I would not have any suggestions on how to try to use Windows.Forms controls as they are not intended to be used here. You should instead be using WPF controls if you wanted to use the UserControlCollection specifically. You can try searching online for general solutions for using Windows.Forms in a WPF environment as you have, however this is not the intended use case for the user control collection and would not be something our support can assist with.

    Transparency is used in the overall Chart window, any controls which require that be disabled will not work in an NTWindow. Generally any custom charting/rendering should be done using OnRender. If you mean to create a custom chart overlay over an existing chart, that is a good use case for OnRender.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Clear. Thank you.

      Am trying now to use some free libraries.
      And I had an issue with https://lvcharts.net
      I downloaded package, added Reference to dll, tried different versions etc. but each time when NT starting I see error window: "Unable to retrieve type info for 'NinjaTraderAinjaScriptAddOnaase• from assembly 'LiveChafls Wpf: unable to load one or more of the requested types Retrieve the LoaderExceptions property for more information".
      Is this something that can be fixed?

      UPD: have same issue with http://www.oxyplot.org library. So, is the reason my system, or NT nuances, or exact libraries details?
      Last edited by fx.practic; 07-18-2019, 05:44 AM.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello fx.practic,

        This really depends on what you tried to reference, a lot of packages are released for multiple framework versions. The error you are seeing may be caused if the incorrect version was used or some resource of that reference was not found.

        For these type of items, our support can generally only provide details on what the requirements for a reference are and some guidelines surrounding this process, you will likely need to dig into this yourself to see where the problem is with what you have downloaded.
        • The reference needs to be .net 4.5 or less, this does not include portable or core versions, it needs to be a desktop .net 4.5 assembly.
        • All requirements for the reference need to be placed in the folder: Documents\NinjaTrader 8\bin\Custom
        • Ensure you reference all dll's for what you are trying to use, see the API docs for the reference you download to make sure you reference the correct dlls.
        • If you cannot get it working, try using visual studio to create a .net 4.5 project and then create something that uses the dll then build it. The output should contain the required dlls and other content which you can then copy into your user folder.
        • If you are using visual studio/nuget to acquire the files, make sure the visual studio project is targeting .net 4.5 before restoring packages.

        For the items you are providing, you may also need to create your own custom Window instead of using an existing Chart or NTWIndow. If these require transparency you would need to create your own WPF Window as this avoids using the default NinjaTrader styles.

        I look forward to being of further assistance.




        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank You. I am crying.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottW, Today, 06:09 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by ScottWalsh, Today, 06:52 PM
          0 responses
          3 views
          0 likes
          Last Post ScottWalsh  
          Started by ftsc2022, 10-25-2022, 12:03 PM
          5 responses
          256 views
          0 likes
          Last Post KeyonMatthews  
          Started by Board game geek, 10-29-2023, 12:00 PM
          14 responses
          244 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Waxavi, 04-19-2024, 02:10 AM
          4 responses
          56 views
          0 likes
          Last Post sonia0101  
          Working...
          X