How do I detect the closure of a TabbedGroupMDIManager form?
What do I need to do in order to capture the closing of a form in a TabbedGroupMDIManager?
SIGN IN To post a reply.
6 Replies
AD
Administrator
Syncfusion Team
March 24, 2004 09:42 PM UTC
Hi Ftoomsh,
You could handle the MDI child form''s Closing event for this purpose. Please refer to the sample attached that show this. Let me know if this meets your requirements.
Regards,
Guru Patwal
Syncfusion, Inc.
DS
Derek Stafford
March 25, 2004 09:07 AM UTC
Guru,
Thanks, but I suppose what I was really asking was whether the TabbedGroupMDIManager raises an event when one of its child windows is closed/removed. I haven''t found anything in the Help that suggests this.
ftoomsh
AD
Administrator
Syncfusion Team
March 25, 2004 11:37 PM UTC
Hi Ftoomsh,
Presently, the TabbedMDIManager does not fire any event in response to any of its child forms being closed. I have consulted the development team in this regard, and will update as soon as possible. We appreciate your patience and cooperation.
Regards,
Guru Patwal
Syncfusion, Inc.
AD
Administrator
Syncfusion Team
March 26, 2004 01:26 PM UTC
Hi Ftoomsh,
We will consider this as a feature request. Could you please provide us more information on the usage scenario for this event ? A better perspective will help us decide whether to fire events before and/or after closing/removing and also suggest workarounds if possible. You might also want to take a look at our TabbedGroupedMDIManager control. We appreciate your feedback very much.
Regards,
Guru Patwal
Syncfusion, Inc.
MA
Mark Atkinson
June 3, 2004 08:30 PM UTC
I would also like to know how to "override" the closing of a form in the TabbedMDIGroupManager so that I can close the entire TabbedGroup (rather than a single form).
Speaking of which, I can''t seem to remove a TabbedGroup. Doing something like:
tabbedMDIGroupManager.TabbedGroups.RemoveAt(index);
...doesn''t seem to change the view. I don''t want to dispose of all the forms in the group, I just want the TabbedGroup to be removed from the list. I''m sure I can figure this out in time but any help would be appreciated.
AD
Administrator
Syncfusion Team
June 8, 2004 12:41 PM UTC
Hi Mark,
Follow the steps below for this purpose :
1. Handle the Closing event for each of the child forms
2. Get the TabHost associated with that MDI child form
3. Get the associated MDITabPanel from the TabHost
4. Each of the TabPageAdvs in the MDITabPanel contain the respective MDI child form within their Tag object. Access the MDI child form associated with each MDI child form''s Tag and close it.
Refer to the code below which shows how this can be done :
private void MdiChildFormClosed (object sender, CancelEventArgs arg)
{
// to ensure that the child form
// closing event does not get called recursively
if (flag==0)
{
// get the MDI child form closed
Form2 form = sender as Form2;
// check for the TabGroup in which it is present
foreach(TabPageAdv page in this.tabbedGroupedMdiManager.GetTabHostFromForm(form).MDITabPanel.TabPages)
{
// the tabpage''s Tag stores the MDI form associated with it
Form2 temp = page.Tag as Form2;
if (form == temp)
{
flag=1;
this.CloseAllForms(this.tabbedGroupedMdiManager.GetTabHostFromForm(form).MDITabPanel);
break;
}
}
}
}
private void CloseAllForms(MDITabPanel mdiTabpanel)
{
foreach(TabPageAdv page in mdiTabpanel.TabPages)
{
((Form2)page.Tag).Close();
}
}
The complete sample illustrating this is attached here. Thanks for considering Syncfusion products.
Regards,
Guru Patwal
Syncfusion, Inc.
SIGN IN To post a reply.
- 6 Replies
- 3 Participants
-
DS Derek Stafford
- Mar 24, 2004 08:49 AM UTC
- Jun 8, 2004 12:41 PM UTC