• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 FMtrader, 03-15-2019, 02:30 AM
          6 responses
          31 views
          0 likes
          Last Post James108  
          Started by timko, Today, 08:18 AM
          0 responses
          1 view
          0 likes
          Last Post timko
          by timko
           
          Started by victorsmith, Today, 06:00 AM
          0 responses
          4 views
          0 likes
          Last Post victorsmith  
          Started by sohailashraf, Yesterday, 10:18 PM
          0 responses
          6 views
          0 likes
          Last Post sohailashraf  
          Started by jjnc2006, Yesterday, 07:36 PM
          0 responses
          16 views
          0 likes
          Last Post jjnc2006  
          Working...
          X