MDI Child Controls

B

Brian P. Hammer

If I have a second form that is a mdichild, let's say frm2 and I want to
update a textbox control pragmatically...

In my MDI parent, I open 5 instances

Dim f as new frm2

private sub OpenForm()
for i = 0 to 4
f = new frm2
f.mdiparent = me
f.show
end sub

Now, from my parent, I want to update a textbox1 in the active mdi child,
how can I? When I just try f.textbox1.text = "some text" it updates the
control on the last handle created. I tried finding the active child but
couldn't determine how to go from there after I got it.

Any help and links would be great.

Regards,
Brian
 
B

Brian P. Hammer

Never mind...... It's too late to be doing this....

childForm = Me.ActiveMdiChild
DirectCast(childForm, frm2).textbox1.text = "Some Text"


Thanks,
Brian
 

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