Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. accessing mdi child

accessing mdi child

Scheduled Pinned Locked Moved Visual Basic
htmlcom
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sai Yasodharan
    wrote on last edited by
    #1

    Hi, i have 2 forms, frmtools and frmpad i have created 10 instances of frmpad and loaded them on mdi's load event now i want to do the operations only if the CurrentChild is any of the instances of frmpad. if the CurrentChild is frmtools then nothing should happen for that i have set the tag property of frmpad to "yes" and the tag property of frmtools to "no" and written the following: if Me.ActiveMDIChild.tag = "yes" then dim a as frmpad = me.ActiveMDIChild it works also. but, i don't know the use of tag property. will there be any problems due to the change of tag property or is there any other way to achieve this.

    Known is a Drop, UnKnown is an Ocean More about me at http://in.geocities.com/slagio2002/me.html

    D 1 Reply Last reply
    0
    • S Sai Yasodharan

      Hi, i have 2 forms, frmtools and frmpad i have created 10 instances of frmpad and loaded them on mdi's load event now i want to do the operations only if the CurrentChild is any of the instances of frmpad. if the CurrentChild is frmtools then nothing should happen for that i have set the tag property of frmpad to "yes" and the tag property of frmtools to "no" and written the following: if Me.ActiveMDIChild.tag = "yes" then dim a as frmpad = me.ActiveMDIChild it works also. but, i don't know the use of tag property. will there be any problems due to the change of tag property or is there any other way to achieve this.

      Known is a Drop, UnKnown is an Ocean More about me at http://in.geocities.com/slagio2002/me.html

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The tag property is just a place to put any piece of data you want. It's not used by anything in the .NET Framework. Think of it as a little box to put anything you want attached to that instance of the form. There are other ways of doing it, like seeing if the ActiveMdiChild is of a specific form type:

      Dim currentForm As Form
      If TypeOf(currentForm) Is frmPad Then
          Dim padForm As frmPad = DirectCast(currentForm, frmPad)
          ... do whatever you need to do to the form ...
      End If
      

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        The tag property is just a place to put any piece of data you want. It's not used by anything in the .NET Framework. Think of it as a little box to put anything you want attached to that instance of the form. There are other ways of doing it, like seeing if the ActiveMdiChild is of a specific form type:

        Dim currentForm As Form
        If TypeOf(currentForm) Is frmPad Then
            Dim padForm As frmPad = DirectCast(currentForm, frmPad)
            ... do whatever you need to do to the form ...
        End If
        

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        S Offline
        S Offline
        Sai Yasodharan
        wrote on last edited by
        #3

        thanks for ur help now its working fine

        Known is a Drop, UnKnown is an Ocean More about me at http://in.geocities.com/slagio2002/me.html

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups