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

How to activate child form

2 Answers 218 Views
Form
This is a migrated thread and some comments may be shown as answers.
jayanthi
Top achievements
Rank 1
jayanthi asked on 26 Jul 2010, 11:03 AM
In MDI application, i have placed New,Edit,Delete buttons in parent form.
I have a child form to display the data in listview.

Problem is;
To delete a record in listview child form,process is like 'Select row in listview in child form, then click Delete button in parent form which will ask for confirmation in message box; once clicked yes it deletes the record but child form doesn't activates to refresh the listview.

Any idea how to activate child form from parent (child form is visible), am using vs2008

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 23 Sep 2010, 10:01 AM
Hi, 

I think I know what you mean. You just want to activate a form as an MDI that is already showing? 
If so, then this is how we do this... 

If Me.Contains(form) Then
    ' Activate the form
    Dim host As Telerik.WinControls.UI.Docking.HostWindow = CType(form.Parent, Telerik.WinControls.UI.Docking.HostWindow)
    RadDock.ActivateWindow(host)
Else
    ' Show the form for the first time
    form.MdiParent = Me
    form.Show()
    Dim host As Telerik.WinControls.UI.Docking.HostWindow = CType(form.Parent, Telerik.WinControls.UI.Docking.HostWindow)
    RadDock.ActivateWindow(host)
End If
0
Stefan
Telerik team
answered on 29 Sep 2010, 09:24 AM
Hi guys, 

Thank you both for writing.

@Richard
Thank you for the assistance. Actually, I do not think that jayanthi is using Docking in its application. Most probably, he uses MDI forms and wants to activate them.

@jayanthi
I have tested the described scenario with the latest version of our controls and it seems that there is no need to explicitly "activate" the MDI child form. Please refer to the attached project for further details. 

If you still need to focus a form, simply use its Focus() method.

I hope you find this information helpful. If there is anything else I can assist you with, do not hesitate to contact me.

Sincerely yours,
Stefan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Form
Asked by
jayanthi
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or