This is a migrated thread and some comments may be shown as answers.

MdiChildActivate is not working

3 Answers 134 Views
Dock
This is a migrated thread and some comments may be shown as answers.
tree
Top achievements
Rank 1
tree asked on 04 Nov 2014, 04:39 AM
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?

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 06 Nov 2014, 11:41 AM
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.

 
0
tree
Top achievements
Rank 1
answered on 14 Nov 2014, 07:27 AM
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?
0
Dimitar
Telerik team
answered on 18 Nov 2014, 04:32 PM
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.

 
Tags
Dock
Asked by
tree
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
tree
Top achievements
Rank 1
Share this question
or