MdiChildActivate is not working

4 posts, 0 answers
  1. tree
    tree avatar
    4 posts
    Member since:
    Oct 2014

    Posted 03 Nov 2014 Link to this post

    ToolWindow tool = new ToolWindow();
                           tool.Text = form.Text;
     
                           this.radDock1.FloatWindow(tool, new Rectangle(new Point(this.DesktopBounds.X + this.DesktopBounds.Width / 2 - formWidth / 2,
                           this.DesktopBounds.Y + this.DesktopBounds.Height / 2 - formHeight / 2), new Size(formWidth, formHeight)));
          
                           form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                           form.TopLevel = false;
                           form.Dock = DockStyle.Fill;
                           form.Show();
                           foreach(DockWindow dock in this.radDock1.DockWindows)
                           {
                               if(GesHelper.Equals(dock.Name, tool.Name))
                               {
                                   dock.Controls.Add(form);
                                   dock.CloseAction = DockWindowCloseAction.CloseAndDispose;
                                   break;
                               }
                           }
    But the MdiChildActivate is not fired, am i missing something on it?
  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 06 Nov 2014 Link to this post

    Hello Tree,

    Thank you for writing.

    When RadDock is used in MDI mode the MdiChildActivate event is not fired. In this case you can use one of the RadDock events. For example the ActiveWindowChanged event.

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. tree
    tree avatar
    4 posts
    Member since:
    Oct 2014

    Posted 14 Nov 2014 in reply to Dimitar Link to this post

    thx for your help!
    But when i adding the control to the radDock.
    And my control is a form, when i click a text box in my form, the ActiveWindowChanged event do not fire.
    What's wrong with that?
  5. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 18 Nov 2014 Link to this post

    Hi Tree,

    Thank you for writing back.

    This is expected since the text box does not notify its parent that it has received the focus. In this case you can subscribe to the GotFocus event and manually activate the window (this event handled can be used for other controls as well): 
    void box_GotFocus(object sender, EventArgs e)
    {
        Control box = sender as Control;
        
        radDock1.ActiveWindow = box.Parent.Parent as HostWindow;
    }

    I hope this helps.

    Regards,
    Dimitar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top