|
-
Jun 28th, 2004, 02:01 AM
#1
Thread Starter
New Member
Sdi, Mutiple Forms
I was interested in creating an application with 10+ screens. I want to be able to switch screens and only have one active at a time. Yet, the problem I'm have is that I can't get the screens to fit within the CLIENT area of the main form. I wanted to somehow make these screens use the main menu(or appear to be using the main menu of the main form).
I'm particularly interested in having a FORM for each RECORDSET in a database application. I used APP wizard to create the app. but when I active the database forms I can't get them to occupy the client area: ....sorry to repeat myself, just wanted to give a more focused/detailed explination of my goal.
When I active any of the other screen via a form.show, it pops up like a dialog box but is not restricted to the client area. I can center it on the main form but I can't find a command that will resize it to fit in the client area.
Is there a way to do this in VISUAL BASIC?
There are two other approaches that might solve my problem.
If I can find the upper left hand coordinate of the client area, then I can get the from to show itself from that reference point.
or
I can place a menu on all the the forms hide the main form and it's menu when I want to active the other forms.
Any ideas??
TIA
-
Jun 28th, 2004, 02:26 AM
#2
Lively Member
Hi,
I think MDIForm will solve your problem. In your project, just add an MDIForm and make all the other forms as the MDIChild, which can be found in the properties of each form. Just set MDIChild as true. Start your project with MDIForm, which can be specified in Project Properties. You can use the MDIForm to hold the menu.
You can get the Screen details using Screen object.
Hope you had some ideas
Gs
-
Jun 28th, 2004, 02:35 AM
#3
Thread Starter
New Member
Thanks, I will try that again, but I just found something that almost works.
If in my SDI project, I remove the border from the forms, when I run the program they forms appear to use up the client area. Only problem is that if I click on the edge of the Mainform, it hides the DATABASE form I'm showing.
Anybody know how to force the form to hidden only by a close button. ... that would solve my problem????
TIA
... I have been chasing this problem down for about a week!!
-
Jun 28th, 2004, 04:14 AM
#4
Junior Member
Query Unload will help
You can try the Query Unload Event. This event will let you cancel the Unload of any form based on criteria. You can modify the following code and unload the form only on Close button on the forms taskbar.
Private Sub Form_QueryUnload(Cancel As Integer, _
UnloadMode As Integer)
' ---------------------------------------------------
' Cancel default is zero. Setting Cancel to
' a non-zero value will stop all forms from unloading.
' ---------------------------------------------------
' ---------------------------------------------------
' Based on the the UnloadMode code
' the system passes, we determine what to do.
' Place your specific code under the
' appropriate case statement.
' ---------------------------------------------------
Select Case UnloadMode
Case 0:
' User used the Control Box Menu in the upper
' left corner or the "X" in the upper right
' corner of the form. If this is one of many
' forms, I send it back to the form that called it.
' One way in, one way out.
Case 1:
' Some other code within this application is causing
' the shutdown. Usually a routine in a BAS module.
Case 2:
' Windows session is closing (i.e. Start, Shut Down)
Case 3:
' Task Manager is closing this application. (i.e.
' Ctrl+Alt+Del, End Task)
Case 4:
' The MDI parent form is closing.
End Select
End Sub
Give me a place to stand and I will move the Earth 
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
|