Announcement

Collapse
No announcement yet.

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.

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


        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 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
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X