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 kujista, Today, 06:23 AM
          5 responses
          15 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by f.saeidi, Today, 10:19 AM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by traderqz, Yesterday, 09:06 AM
          2 responses
          16 views
          0 likes
          Last Post traderqz  
          Started by traderqz, Today, 12:06 AM
          3 responses
          6 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by RideMe, 04-07-2024, 04:54 PM
          5 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X