How can I prevent a child form from going behind a picturebox on MDI 
Author Message
 How can I prevent a child form from going behind a picturebox on MDI

I have a MDI form with a Picturebox aligned on the bottom and I have placed
several controls on the picturebox.

Everything works great except that my child forms can slip behind the
picturebox.  I would like to prevent the bottom of hte child form from going
below the top of the picturebox

Any suggestions??



Fri, 29 Aug 2003 07:31:20 GMT  
 How can I prevent a child form from going behind a picturebox on MDI
If there was no PictureBox at the bottom, the bottom of child forms can go below
the bottom of the MDIForm - in either case, it's normal behavior.

If MDIForm scroll is True, a MDI scroll bar will appear if portion of child form
is out side the client area.

Other than, say, a Status Bar, it is a bit unusual to place controls on a
MDIForm in this manner.  You might consider using something like a floating Tool
Palette, a ToolBar, or a CoolBar for the controls.

Rob

Quote:

> I have a MDI form with a Picturebox aligned on the bottom and I have placed
> several controls on the picturebox.

> Everything works great except that my child forms can slip behind the
> picturebox.  I would like to prevent the bottom of hte child form from going
> below the top of the picturebox

> Any suggestions??



Fri, 29 Aug 2003 11:28:13 GMT  
 How can I prevent a child form from going behind a picturebox on MDI


You can trap the child's form_resize() event, check where the bottom
of the form is in relation to the picturebox, and if goes below move
it back up.

Ie: not tested
private sub form_resize()
    static inResize as boolean
    if inresize then exit sub
    inresize = true

     if top + height > mdiform.picture1.top then
          top = mdiform.picture1.top - height
    endif

    inresize = false
end sub        

Quote:
>I have a MDI form with a Picturebox aligned on the bottom and I have placed
>several controls on the picturebox.

>Everything works great except that my child forms can slip behind the
>picturebox.  I would like to prevent the bottom of hte child form from going
>below the top of the picturebox

>Any suggestions??

Regards, Frank.


Fri, 29 Aug 2003 12:21:48 GMT  
 How can I prevent a child form from going behind a picturebox on MDI
Moving or dragging a Form around, however, does not fire any Resize event.

Rob

Quote:



> You can trap the child's form_resize() event, check where the bottom
> of the form is in relation to the picturebox, and if goes below move
> it back up.

> Ie: not tested
> private sub form_resize()
>     static inResize as boolean
>     if inresize then exit sub
>     inresize = true

>      if top + height > mdiform.picture1.top then
>           top = mdiform.picture1.top - height
>     endif

>     inresize = false
> end sub

> >I have a MDI form with a Picturebox aligned on the bottom and I have placed
> >several controls on the picturebox.

> >Everything works great except that my child forms can slip behind the
> >picturebox.  I would like to prevent the bottom of hte child form from going
> >below the top of the picturebox

> >Any suggestions??

> Regards, Frank.



Fri, 29 Aug 2003 18:26:21 GMT  
 How can I prevent a child form from going behind a picturebox on MDI

Great, i really should have shut up last night.. :)
You're right..it doesn't trigger it.
That sucks. Another reason why VB could've really used a
window_message function. :(  Back to subclassing we go. :-/

Quote:
>Moving or dragging a Form around, however, does not fire any Resize event.

>Rob




>> You can trap the child's form_resize() event, check where the bottom
>> of the form is in relation to the picturebox, and if goes below move
>> it back up.

Regards, Frank.


Fri, 29 Aug 2003 22:53:12 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. MDI Form problem- Child Forms hidden behind picture.

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

3. ActiveX DLL windows goes behind MDI form

4. MDI Help - Prevent Child Form from Exiting in Unload Event

5. MDI Help - Prevent Child Form from Exiting in Unload Event

6. How to prevent user to open more than one mdi child form

7. MDI Child form goes underneath a panle on parent

8. Control box on MDI child form not going away

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

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

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

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

 

 
Powered by phpBB® Forum Software