How to activate child form

3 posts, 0 answers
  1. jayanthi
    jayanthi avatar
    111 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2010 Link to this post

    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. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Sep 2010 Link to this post


    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)
        ' Show the form for the first time
        form.MdiParent = Me
        Dim host As Telerik.WinControls.UI.Docking.HostWindow = CType(form.Parent, Telerik.WinControls.UI.Docking.HostWindow)
    End If
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stefan
    Stefan avatar
    2891 posts

    Posted 29 Sep 2010 Link to this post

    Hi guys, 

    Thank you both for writing.

    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.

    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,
    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
Back to Top