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 WinForm control into chart?

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

    How to add WinForm control into chart?

    I have a demonstration sample:
    Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.


    it demonstrates how to add a Control (button or etc) on chart.
    It works well for WPF kind controls, but I am having problem to insert WinForms kind control.

    The code shows to parts, commented with "Add WPF" and "Add WinForms".

    so, the WPF button is inserted on chart, but the second not.
    (btw, i have tried to reference `ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\ WindowsFormsIntegration.dll` and the 3.5# version too, but neither worked.

    #2
    Hello ttodua,

    As NT8 uses WPF now all I can really suggest is to redesign what you are doing in WPF to match the host window framework. You can search for other C# solutions related to hosting windows forms in wpf however our support would not be able to assist with anything windows forms related. This is mainly because that was never supported in 7 and we have no guidelines for working in windows forms. If you are having difficulty in converting a windows forms project to WPF you can post those type of questions here, our support can try to make suggestions however other users may be of more help in that situation.


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

    Comment


      #3
      Jesse, thanks for reply.
      It's always pleasure my posts being answered by you...
      I know that is the recommendation about WPF.
      but...
      I will take just a minute of you if possible...

      NET officially supports that WinForms elements can be shown in WPF using that "WindowsFormsIntegration.dll"


      please see the updated code on that link - I've made the minimal working example.

      after you add that indicator to chart, please see yourself:

      Click image for larger version

Name:	mZL2h01.png
Views:	324
Size:	3.9 KB
ID:	1088027

      on the right side of WPF textbox, there is empty (transaprent) area, however there is ACTUALLY the element, and try to mouseover there! even the added MouseOver event is catched.

      Later I've found something, that i doubt of it:




      (also, similar topics were here:


      Comment


        #4
        Hello ttodua,

        Thank you for the reply.

        NET officially supports that WinForms elements can be shown in WPF using that "WindowsFormsIntegration.dll"
        That is correct for C# in general but that is not what window framework NinjaTrader 8 uses and also not a concept we can help with. You can use most C# code in NinjaScript however our support won't be able to assist in all areas of C#, not all C# is going to be a NinjaScript item that we could help with. If the community has any input here they could certainly add that however I would not have anything additional I could provide on the topic of getting windows forms working in wpf.

        If using windows forms is crucial for your goal you can look at external resources to try and work around any problems you find as you have been. I see one link you provided relates to transparency, The NT windows do use transparency because a custom window is being used. If what you are trying to do has conflicts with transparency you wont likely be able to use it.



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


        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frankthearm, Yesterday, 09:08 AM
        13 responses
        45 views
        0 likes
        Last Post frankthearm  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        55 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by yertle, Yesterday, 08:38 AM
        8 responses
        37 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Working...
        X