Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 VB limits of controls
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kingkirb
Squire

United Kingdom
19 Posts

Posted - May 24 2006 :  5:27:55 PM  Show Profile  Reply with Quote
Ok making my game and i decide i want to add a new feature. i start about doin this fine but when i try to put a new command box(well a new anything!) i get a mesage"Reached limit. cannot create any more controls for this form." is ther away i can make this limit higher?
Thnx J(kingkirb)

kingkirb
Squire

United Kingdom
19 Posts

Posted - May 24 2006 :  6:10:37 PM  Show Profile  Reply with Quote
To try and fix this i have made a new form in the same project but i dont seem to be able to call anything form my other form. I am trying to call a global variable but it doesnt recognise it as form the other form and gives it a nill value. I also tried calling a public precedure but that didnt work. Finnally i tried putting my variables into a module and THAT did work. Im stumped!! Help PLZ!! J(kingkirb)

Go to Top of Page

kingkirb
Squire

United Kingdom
19 Posts

Posted - May 25 2006 :  06:34:56 AM  Show Profile  Reply with Quote
Does anyone know how to close a switched form? I tried form1.cls but when i check task manager the form is still active.
what im doin is

dim form1 as new form2
form2.show
form1.hide
form1.cls

the vise versa for the otherway. No matter what combination i try everytime i close(BTW the problem only occurs when i hit the X at the top of the screne which most people hit) the form the program is stil running! Thanks again J(kingkirb)
Go to Top of Page

PW7962
Squire

USA
33 Posts

Posted - May 25 2006 :  2:34:56 PM  Show Profile  Visit PW7962's Homepage  Send PW7962 an AOL message  Reply with Quote
I think I know what you want. Try this "unload Form1" and that should work. Then if you want to show form1 again do this:
"Dim nform as new form1
nform.show"
Using this will close the form, but all information of that form will be lost. I think that answers your question, but if you have questions just ask.

Star Fantasy Unlimited Programmer

http://starfantasy.forumer.com
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - May 25 2006 :  2:36:07 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
Use this to close all open forms
  
Private Sub Form_Unload(Cancel As Integer)  
    Dim f As Form  
    For Each f In Forms  
        Unload f  
    Next
End Sub
  


As for your controls issue, how many controls do you have on a form? You can overcome the limit by using control arrays and/or dynamically creating controls at runtime.
Go to Top of Page

kingkirb
Squire

United Kingdom
19 Posts

Posted - May 25 2006 :  4:28:20 PM  Show Profile  Reply with Quote
Ok thanks very much that solved it!! I used my original code to load and hide the form and then i used the formunload command. Ye what i did was i took a lot of my commands and put them in a new form. I already reuse a lot of my command boxes and labels by movin em round and changin their names and when the name is this blah blah blah to save on code. thanks for al your help again. J(kingkirb)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.