PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2010 [RESOLVED] To access a control of a child form from its parent form-VBForums
Results 1 to 2 of 2

Thread: [RESOLVED] To access a control of a child form from its parent form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2017
    Location
    Nigeria
    Posts
    256

    Resolved [RESOLVED] To access a control of a child form from its parent form

    HOW CAN I ACCESS A CONTROL OF A CHILD FORM FROM ITS PARENT FORM.
    I actually want to access a control of the active Mdi child because all the Mdi children have the same properties.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,439

    Re: To access a control of a child form from its parent form

    You simply cast the ActiveMdiChild property of the form to the appropriate type, e.g.
    vb.net Code:
    1. Dim myChildForm = DirectCast(ActiveMdiChild, ChildForm)
    You can then access any members of the ChildForm type via that variable.

    If it were the case that only some child forms were that type then you could use TryCast instead:
    vb.net Code:
    1. Dim myChildForm = TryCast(ActiveMdiChild, ChildForm)
    2.  
    3. If myChildForm IsNot Nothing Then
    4.     '...
    5. End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width