|
-
Jun 7th, 2006, 12:27 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] MDI Child not working properly
My MDIChild = yes form looks cut off at the bottom. I don't want to but I can resize to show the complete form. When I Maximize, Minimize or Close it works fine within the Parent.
If I change the form to MDIChild = no it is NOT cut off at the bottom but it also doesn't function within the Parent.
I've been reading other resolutions but I'm only becoming more confused.
This has to be a simple Property problem (I hope).
Can you help me..... Thanks
-
Jun 7th, 2006, 12:34 PM
#2
Re: MDI Child not working properly
There are scrollbars at the sides for the MDIparent. If you don't want your child forms to get "cut off" then you'll have to move them around the interior of the mdiparent (top left properties).
You'll have to consider MDiparent resize though. How will you position the child if the parent is resized less than the child form.
-
Jun 7th, 2006, 12:39 PM
#3
Thread Starter
Hyperactive Member
Re: MDI Child not working properly
The child form is cut off at bottom but it is not larger then parent form.
Scrollbars have not come into play here.
-
Jun 7th, 2006, 12:40 PM
#4
Re: MDI Child not working properly
Try to set the form size (child) on form_load event of child.
-
Jun 7th, 2006, 12:46 PM
#5
Thread Starter
Hyperactive Member
Re: MDI Child not working properly
NO.
Doesn't the the form size get set by it's size properties from design time?
I this something that has to be in a Resize_Form() after initial load?
-
Jun 7th, 2006, 12:48 PM
#6
Re: MDI Child not working properly
yes u can set the size in properties.. but also at runtime
in the Form_Load event
Me.top = 0
Me.left = 0
Me.width = xxx
Mie.Height = xxx
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 7th, 2006, 12:50 PM
#7
Thread Starter
Hyperactive Member
Re: MDI Child not working properly
I'll give it a shot and be back with results.
-
Jun 7th, 2006, 12:50 PM
#8
Re: MDI Child not working properly
you could just position it in form_load():
VB Code:
Private Sub Form_Load()
Me.Move 0,0
End Sub
Edit: too slow
-
Jun 7th, 2006, 12:51 PM
#9
Re: MDI Child not working properly
 Originally Posted by Mikey
NO.
Doesn't the the form size get set by it's size properties from design time?
I this something that has to be in a Resize_Form() after initial load?
Since the mdi parent imposes default child size (percentile based on its own current size, around 75%) disregarding design time dimensions, you will have to get the child to insist on its own size at run time.
Static posted sample code above.
-
Jun 7th, 2006, 12:58 PM
#10
Thread Starter
Hyperactive Member
Re: MDI Child not working properly
OK that helped a lot. I put....
Private Sub Form_Load()
On Error Resume Next
Me.Show
Form_Resize
Dim conn As ADODB.Connection
ect..
Private Sub Form_Resize()
On Error Resume Next
Me.Top = 0
Me.Left = 0
Me.Width = 12720
Me.Height = 7380
End Sub
Thanks
-
Jun 7th, 2006, 01:00 PM
#11
Re: MDI Child not working properly
No prob Please take the time to mark the thread as resolved.
-
Jun 7th, 2006, 01:01 PM
#12
Thread Starter
Hyperactive Member
Re: MDI Child not working properly
Me.Move 0,0 alone doesn't do anything.
-
Jun 7th, 2006, 01:01 PM
#13
Thread Starter
Hyperactive Member
Re: MDI Child not working properly
-
Jun 7th, 2006, 01:03 PM
#14
Re: MDI Child not working properly
 Originally Posted by Mikey
Me.Move 0,0 alone doesn't do anything.
We both thought initially that the child form exceeded the parent's interior hence was "cut off". Only after your succeeding posts did we realize that you meant it being cut due to resize.
-
Jun 7th, 2006, 01:07 PM
#15
Re: [RESOLVED] MDI Child not working properly
VB Code:
Private Sub Form_Load()
On Error Resume Next
Me.Show
resize_me
Dim conn As ADODB.Connection
ect..
End Sub
Private Sub resize_me()
Me.Top = 0
Me.Left = 0
Me.Width = 12720
'OR Me.Width = PARENTFORMNAME.ScaleWidth
Me.Height = 7380
'OR Me.Height = PARENTFORMNAME.ScaleHeight
End Sub
Private Sub Form_Resize()
'Use this to resize controls.. not the form
'UNLESS u want the form to be locked in that position and that size
'because if u resize it.. it will snap back to those dimensions
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 7th, 2006, 01:07 PM
#16
Thread Starter
Hyperactive Member
Re: [RESOLVED] MDI Child not working properly
No problem, I can see that. I'll try to be more clear in the future.
Thanks again.
-
Jun 7th, 2006, 01:09 PM
#17
Re: MDI Child not working properly
 Originally Posted by Mikey
OK that helped a lot. I put....
Private Sub Form_Load()
On Error Resume Next
Me.Show
Form_Resize
Dim conn As ADODB.Connection
ect..
Private Sub Form_Resize()
On Error Resume Next
Me.Top = 0
Me.Left = 0
Me.Width = 12720
Me.Height = 7380
End Sub
Thanks
Form_Resize event will automatically fire when the form is shown, you're firing it twice.
you should have no problems with
VB Code:
Private Sub Form_Load()
Me.Move 0, 0, 12720, 7380
Me.Show
'
'
'
End Sub
as leinad said, i didn't realise you wanted to set the height/width.
using .Move is quicker than setting them all individually
-
Jun 7th, 2006, 01:09 PM
#18
Thread Starter
Hyperactive Member
Re: [RESOLVED] MDI Child not working properly
Oh how interesting. Nothing is easy is it?
I'll try this code and be back....
Thanks
-
Jun 7th, 2006, 01:12 PM
#19
Thread Starter
Hyperactive Member
Re: [RESOLVED] MDI Child not working properly
Well Me.Move 0, 0, 12720, 7380
Me.Show
works nicely.
-
Jun 7th, 2006, 01:24 PM
#20
Thread Starter
Hyperactive Member
Re: [RESOLVED] MDI Child not working properly
Private Sub resize_me() Me.Top = 0 Me.Left = 0 Me.Width = 12720 'OR Me.Width = PARENTFORMNAME.ScaleWidth Me.Height = 7380 'OR Me.Height = PARENTFORMNAME.ScaleHeight End Sub
This cuts it off again.
Me.Move 0, 0, 12720, 7380
Me.Show
works nicely.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|