Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a self made property of the child active window

Status
Not open for further replies.

JDAEMS

Programmer
Aug 27, 2003
84
BE
Dear sir/madam,

In the parent MDI I do File/New and a MDI child opens up.

In the class of this MDI child I have made a property like this:

Property ModuleNumber() As Integer
Get
Return Me.modulenr
End Get
Set(ByVal Value As Integer)
Me.modulenr = Value
End Set
End Property

I am able to save a value in this property, but I am not able to get it out.

I want to get the value of the property Modulenumber of the active MDI child. How do I get this?

When I do this:
a = Me.ActiveForm.Modulenumber.value

Then it complains with the following message:
ModuleNumber is not a mmeber of 'System.windows.forms.form'

Can anyone help me with this on how to gt the value of the preorpty of the active child?

Thanks you in advance.
Jelle
 
What you need to do is declare a variable with the type of the form you have open (the one that has the property) and assign it the value in Me.ActiveForm.
Code:
Dim f As FormChild
f = Me.ActiveForm
MsgBox(f.ModuleNumber)
Be careful though you might want to check to make sure the form in ActiveForm is of type FormChild before assigning so problems don't occur.
 
firstly declare it public property

and secondly

you don't need the .value at the end.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top