accessing mdi child
-
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
-
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
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 -
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, 2007thanks 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