Active MDI Child problem

O

Omar Abid

Hi

I have an MDI container that contain some MDI Child form

I use the following code to get the active MDI child Text (title) :



Dim activepreview As Form = Me.ActiveMdiChild

If activepreview IsNot Nothing Then

Me.refcode.Text = activepreview.Text ' Get the title

Else

Me.refcode.Text = "No window Selected"

End If



Now I have a Label on the MdiActiveChild I want to change text and
some other properties on this Label.

How can I do this

Thank you

Omar Abid

www.omarabid.uni.cc
 
A

Armin Zingler

Omar Abid said:
Hi

I have an MDI container that contain some MDI Child form

I use the following code to get the active MDI child Text (title) :



Dim activepreview As Form = Me.ActiveMdiChild

If activepreview IsNot Nothing Then

Me.refcode.Text = activepreview.Text ' Get the title

Else

Me.refcode.Text = "No window Selected"

End If



Now I have a Label on the MdiActiveChild I want to change text and
some other properties on this Label.

How can I do this


If TypeOf me.activeMdiChild Is TypeOfChild Then
Directcast(me.activeMdiChild, TypeOfChild).Label1.Text = "..."
end if


You can ommit the If+EndIf if you don't have different types of child forms.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top