Home Forums WinForms controls Other WinForms controls Docking Manager and ToolWindow

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18533 |

    I have this Form that inherits from the ToolWindow and this form contains one of your SmartExplorer controls with controls inside of it. It is showing on my main form correctly but what I need to do is when the form is being loaded I need to enable / disable some of the controls on the toolwindow. Any help would be appreciated.

    Imported from legacy forums. Posted by Dewayne (had 2492 views)

    User (Old forums)
    Member
    Post count: 23064

    There is a few ways you can do this.  First if you do this at Form_Load, you probably create you ToolWindow there, and add it to the DockLayoutManager, so you can access the buttons directly from the instance of the ToolWindow.

    If you want to access it in a later event, you can do it from the DockLayoutManager.

    e.g.:

    //Assuming I have a ToolWindow class named ToolButtons.

              ToolButtons toolWindow = this.dockLayoutManager1.ToolWindows[ 0 ] as ToolButtons;
              Button button = toolWindow.Controls[ 0 ] as Button;

    You can also declare your ToolWindow as a private variable to the Form class, and access it has you need in the different events directly.

     

    Imported from legacy forums. Posted by André (had 2601 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.