Referencing MDI Child forms? 
Author Message
 Referencing MDI Child forms?

Hi!

How can I reference several MDI Child forms?

The problem simplified is that I have two or more MDI Child forms and in
each of them a picture. I want to be able to print all of these pictures
from a modal printing window, but I can only reference one form, namely the
active MDI Child forms picture, like

Printer.PaintPicture MDIForm.ActiveForm.Picture, left%, top%, width%,
height%

How can I change the active child form in code from an other form, so I
could print all the pictures within the same funtion?

I have tried referencing the Forms-collection, like

For i% = 1 To Forms.count
    MDIForm.ActiveForm = Forms(i% - 1) 'This causes an error message
    'Print the new picture
Next i%

but that did'nt work. Any ideas? Thank you for your help.

Mika Varpio

---

WWW:         http://www.*-*-*.com/
Address:    Ojaniituntie 14
            FIN-01820 Klaukkala
Phone:      +358 9 8789 4201
Telefax:    +358 9 8789 4202



Sun, 21 Apr 2002 03:00:00 GMT  
 Referencing MDI Child forms?


Quote:
> Hi!

> How can I reference several MDI Child forms?

> The problem simplified is that I have two or more MDI Child forms and in
> each of them a picture. I want to be able to print all of these pictures
> from a modal printing window, but I can only reference one form, namely
the
> active MDI Child forms picture, like

> Printer.PaintPicture MDIForm.ActiveForm.Picture, left%, top%, width%,
> height%

> How can I change the active child form in code from an other form, so I
> could print all the pictures within the same funtion?

> I have tried referencing the Forms-collection, like

> For i% = 1 To Forms.count
>     MDIForm.ActiveForm = Forms(i% - 1) 'This causes an error message
>     'Print the new picture
> Next i%

> but that did'nt work. Any ideas? Thank you for your help.

> Mika Varpio

set the tags of the forms to unique strings.  you can then loop through the
forms collection to find each form.  then use zorder or setfocus to bring
the form to the front.

otoh, that's an especially inelegant solution.  hopefully some else will
have a better solution.

- Show quoted text -

Quote:

> ---

> WWW:        http://www.codeman.fi
> Address:    Ojaniituntie 14
>             FIN-01820 Klaukkala
> Phone:      +358 9 8789 4201
> Telefax:    +358 9 8789 4202



Mon, 22 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Make a reference to a MDI form with a reference of a MDI child form

2. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

3. MDI Form with MDI Child in referenced DLL

4. MDI Child Form Reference Invalid

5. Modifying object in MDI Parent form from MDI Child form

6. MDI-Child form and positon on MDI-form

7. Developing OLE MDI Child forms displayed on Control MDI Form

8. MDI child forms on top of a picture on a MDI form

9. Help with MDI Forms and MDI child forms

10. Modal non MDI forms and Modeless MDI child forms in VB 5.0

11. Allow MDI Child form to overlap Aligned Picture Box in MDI Form

12. Having MDI form with MDI Child form in DLL

 

 
Powered by phpBB® Forum Software