Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

With Multiple forms how do I check that a form is open 2

Status
Not open for further replies.

Trowser

IS-IT--Management
Dec 16, 2002
125
0
0
GB
I have 8 forms
when a user opens one form it shows up when he opens the next form I want that one to show up below it when he opens the next one it shows up below the other 2 in, and it makes no differance what order he opens the forms.

 
No not that way m8 I dont want it to go behind the form I want it to go beneath the form

If form1.height = 1000
then me.top = 1000
elseif form2.height = 1500
then me.top = me.top+1500
end if

me being the third form

but I want it in any order
I wanna be able to count the ammount of forms open and know what forms are open so that when the form the user has select loads up it appears below the other forms

thanks :)
 
try something like this:

Dim i As Integer
For i = 0 To Forms.Count - 1
If Forms(i) Is form1 Then
msgbox "Loaded"
End If
Next
 
try using mdiform for the main form and all other forms as child.
 
ok thanks guys I will try those ideas
 

Count the number of loaded forms, excluding the MDI form.

Get the scale height/width of the MDI

Divide that by the number of forms and then set each form's height to that value.

Now, loop though the forms collection and, using a variable to keep track of the top position + height of the last positioned form, set the position of the next form. [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Thanks guys
Doc that worked fine and dandy

Clint Cool Adapting code to do that :) Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top