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

AddOnPage TopMost

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

    AddOnPage TopMost

    Hi,

    How can I make a window, completely based on your AddOn sample, to become TopMost? (Just like This.Topmost = true works for a regular WPF form)

    Thx
    Jmneto

    #2
    Hello jmneto,

    Thanks for your post.

    We had a bit of volume this morning, but your message has been received and I'll reply after I have been able to able to fully review.

    Ok, I am not having an issue setting Topmost from the constructor of the AddOnFrameworkWindow (inherited from NTWindow.)

    For example:

    Code:
        public class AddOnFrameworkWindow : NTWindow, IWorkspacePersistence
        {
            public AddOnFrameworkWindow()
            {
                Topmost = true;
                // set Caption property (not Title), since Title is managed internally to properly combine selected Tab Header and Caption for display in the windows taskbar
                // This is the name displayed in the top-left of the window
                Caption = "AddOn Framework";
    Please let us know if we can be of further assistance.
    Last edited by NinjaTrader_Jim; 10-22-2018, 01:41 PM.
    JimNinjaTrader Customer Service

    Comment


      #3

      Hi Jim,

      I am trying to have a checkbox inside the NTTab that sets/unsets topmost. So the issue is how to set this dynamically from the AddOn Page:
      tc.AddNTTabPage(new NinjaTraderAddOnProject.AddOnPage());
      I cannot set Topmost = true from the AddOnPage class since it does not derive from NTWindow.

      Comment


        #4
        Hello jmneto,

        I've attached an example a colleague has put together that adds a context menu for setting Topmost. This adds a control to the NTWindow.

        For your purposes, you could try creating a private Window variable "myWindow" within the scope of the AddOn page and then within a control, get the window with myWindow = Window.GetWindow(this); and then set Topmost with myWindow.TopMost.

        I added the GetWindow code within the button press for "Account Executions" in the AddOn Framework example and was able to set Topmost without issue.

        Code:
                    // When user presses the Account Executions button
                    if (button != null && ReferenceEquals(button, acctExecButton))
                    {
                        myWindow = Window.GetWindow(this);
                        myWindow.Topmost = true;
        Please let us know if we can be of further assistance.
        Attached Files
        JimNinjaTrader Customer Service

        Comment


          #5
          Thank you Jim, Window.GetWindow(this).Topmost solved the issue.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by timko, Today, 06:45 AM
          0 responses
          0 views
          0 likes
          Last Post timko
          by timko
           
          Started by JonesJoker, 04-22-2024, 12:23 PM
          7 responses
          41 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Waxavi, 04-19-2024, 02:10 AM
          2 responses
          37 views
          0 likes
          Last Post poeds
          by poeds
           
          Started by chbruno, Yesterday, 04:10 PM
          1 response
          44 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Max238, Today, 01:28 AM
          1 response
          24 views
          0 likes
          Last Post CactusMan  
          Working...
          X