Click to See Complete Forum and Search --> : Fixed Size MDIform
rlecjr
March 29th, 2001, 10:55 AM
I am trying to set the MDIForm so that it cannot be resized by the user, but cannot seem to find the property to do this. I am able to fix the child within the MDIForm, but cannot fix the MDIForm itself. Anybody have the answer??
Thanks,
Ron
Johnny101
March 29th, 2001, 12:56 PM
I think you might have to use the Form's Resize event and just force the size to be whatever you want it be.
'set the values to be whatever the forms size should be
private Sub MDIForm_Resize()
me.Height = 6270
me.Width = 8055
End Sub
this surely, isn't the best solution because the form flickers when you try to resize it, but it stops the user resizing the form.
if i think of another way (with API probably), i'll let you know,
john
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
rlecjr
March 29th, 2001, 03:11 PM
Thanks - I was hoping there was some parameter that could be set... That is kind of odd that there isn't. The MDIForm expands, but the child does not expand with it... I guess it would be okay if they expanded together. Do you know if there is a way to do that? They only thing that I am really using the MDIForm for is the menu bar. I would have to repeat the menus in every form if I did not do that...
Thanks a lot,
Ron
Johnny101
March 30th, 2001, 03:17 PM
you could write code, again, in the MDIForm_Resize() event to "scale" the child form's size to be whatever you wanted. you'll have to play around with it, it can be alittle tricky.
as for duplicating the menus, unfortunately, there's no really easy way of doing this. you could probably use the VB6 Template Manager Add-In with your own custom menu template item. go to Add-Ins menu, then Add-In Manager and select the VB6 template Manager. then open it up and away you go. before you do this, you'll have to build a new form with the menu you want to copy across the other forms and save it in the Templates\Menus directory under the VB98 directory (or whereever you installed VB at).
hope this helps,
john
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
shree
March 30th, 2001, 07:34 PM
If you have finalised your menu structure, you can copy it in multiple forms as follows:
Create the menu structure in one form.
Open it in a text editor
Copy the code relevant to the menu. For example, I copied the following code
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileNew
Caption = "&new"
End
Begin VB.Menu mnuFileOpen
Caption = "&Open"
End
Begin VB.Menu mnuFileExit
Caption = "&Exit"
End
End
Begin VB.Menu mnuEdit
Caption = "&Edit"
Begin VB.Menu mnuEditCopy
Caption = "&Copy"
End
Begin VB.Menu mnuEditPaste
Caption = "&Paste"
End
End
from one form and pasted it into another, in the corresponding location in Form2. And the same menu appears in another form.
For the Event Handlers of the menu, you can do the actual code in a module and call the functions from the form. Or make the event handlers of one form public and call them from the other forms.
rlecjr
March 30th, 2001, 11:27 PM
Johnny and shree.. thanks a lot. I will look at my options now and go from here.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.