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

WindowsFormsHost not visible in NTTabPage

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

    WindowsFormsHost not visible in NTTabPage

    Hi there,

    I used to work with WindowsFormsHost (in WindowsFormsIntegration.dll) to host indispensable Windows Forms controls in WPF applications.
    Works great in other WPF applications but not with NTTabPage of the demo NinjaTraderAddOnProject as the hosted control is 'alive' but not visible on a NTTabPage.

    I've added these references to my add-on:
    - System.Windows.Forms
    - WindowsFormsIntegration

    Here's the complete code of AddOnPage.xaml to host a MaskedTextBox:

    <t:NTTabPage x:Class="NinjaTraderAddOnProject.AddOnPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:t="clr-namespace:NinjaTrader.Gui.Tools;assembly=NinjaTrad er.Gui"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Win dows.Forms">
    <Grid>
    <WindowsFormsHost Width="200" Height="200">
    <wf:MaskedTextBox x:Name="mtbDate" Mask="00/00/0000"/>
    </WindowsFormsHost>
    </Grid>
    </t:NTTabPage>

    Any ideas why nothing is visible in NT?
    Many thanks for any assistance or tips!!!
    Last edited by ruppschtaler; 02-28-2017, 09:25 AM.

    #2
    Hello ruppschtaler,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Do you have the full project you can attach to your response or send over to us? Our email is platformsupport[at]ninjatrader[dot]com, please send the file with 'ATTN: Patrick H' in the subject line and reference this thread.

    Have you looked into the our updated Add On example at the following link?https://ninjatrader.com/support/help...t_overview.htm

    I look forward to your response.

    Comment


      #3
      Have you ever been able to find out the solution? if you could share.

      Comment


        #4
        Providing compatibility with WindowsFormsHost is extremely desirable. Please add a New Feature Request for this, if it does not already exist, and if there is no other approach that will work.

        Thanks.
        Multi-Dimensional Managed Trading
        jeronymite
        NinjaTrader Ecosystem Vendor - Mizpah Software

        Comment


          #5
          Hello,

          I will put in a feature request however this is a .NET control and not something which NinjaTrader has control over. This is very likely something you will need to debug if that is something you want to use. While .net does allow for WindowsFormsHost to be used in WPF in some situations this is not something we can support, we can only suggest using WPF content here.

          The problem is likely that the NT8 windows use transparency which is not something the WindowsFormsHost supports, you could try to use a normal WPF window instead of NTWindow if you wanted to try to avoid that or you could re program what you have as a WPF control.


          Please let me know if I may be of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Thanks, Jesse, as always.

            I understand the issues. Unfortunately, even some WPF controls seem incompatible with NT8. WebBrowser, for example.

            I have had to design a few WPF equivalents for standard WinForms controls that do not have an equivalent in WPF. Whilst good to have, the process makes rolling out software much more time-consuming. If one could use WindowsFormsHost in the interim, it would most definitely be useful.

            Thanks.
            Multi-Dimensional Managed Trading
            jeronymite
            NinjaTrader Ecosystem Vendor - Mizpah Software

            Comment


              #7
              Hello jeronymite,

              The webbrowser control is another that does not support transparency well, in that situation you would use your own window instead of an NT window. You could also search google for some work around on that being used with transparency, as this is not a NinjaTrader control and is not used in the platform there may be problems using it in existing windows.

              In general working with WPF controls is a more advanced area which can take some debugging or working around as the platform uses the existing controls in a specific way and applies styles for those controls. You are making an addition to an existing program here rather than developing on your own so there are some stipulations surrounding what can be accomplished for GUI modifications.

              Another point here against using an NT window for the WindowsFormsHost is that the windows forms controls won't share the style of the WPF NTWindow. Creating a standard WPF window would likely be closer to what the controls would normally look like in windows forms and would potentially avoid the issue. You could give that a try to at least get whatever it is working for your use case while you develop an equivalent NT8 WPF control that meets your needs.

              Please let me know if I may be of additional assistance.




              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              32 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Started by frankthearm, Today, 09:08 AM
              5 responses
              21 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              43 views
              0 likes
              Last Post jeronymite  
              Working...
              X