Help - Search - Members - Calendar
Full Version: Visual Basic (2005 Express)
BleepingComputer.com > Software > Programming
   
thisismydisplayname
I am a beginner in VB.

I have it so when I click on a button, it makes another form appear. It simply changes the forms "visible" property from "false" to "true" when it is clicked. How do I make this process more efficient? (I assume the form is loaded when the program is, since it only changes it's visible property, instead of opening it. How do I make it load an instance of the form?)

Once haveing done the above, how do I allow the form be able to be opened with multiple instances? Or, is that already enabled?

Also, how do I refer to a form in a folder? ie:
I have a code that is executed with an OnClick, like this "Form2.Visible = True", how do I refer to a form named "FormThis" that is in the folder "HolyFolder" ? (This code is in Form1 that is created when you start a new project.)
raw
First i have to ask, why do you want to load the same form multiple times?

"FormThis" will have to be added to the project. You can not open a form from
a folder. (unless you are opening it from VB)
While this is not entirely true, the form can not be imported into the running program.

No matter how many forms you have they all become part of the executable which
is loaded in memory when you run the program. Whether they are hidden or visible
makes no difference.

If you want some example projects I am more then happy to share some of my code with you.
I wrote the Bleeping Computer screen saver and the HOSTfix program used here at BC.
thisismydisplayname
Yes, I would like some examples.
Well, in the IDE it showed them as being in different folders, and I believe it allowed me then to name a form the same thing as another form if they were both in different folders, but then doing the visible = yes thing would only work when referencing it as the name it was defaultly given.

Well, I want multiple instances of the same form to open up while using the program so that multiple people can keep track of their characters stats at the same time. Me and my friend got bored and made a stupid board MMORPG game thing, and I was going to make a program to do all the math for us.

How would I implement the FormThis property thing?
raw
Multiple people will be using the same program at the same time?
Personally I would build Form1 to call all the new forms, such as:

Form1 - Add buttons - Monster1, Monster2
Then create MonForm1, MonForm2 and use "Show" for the new forms.

Gimme a few and I will whip up some sample forms for you.

http://www.rawcreations.net/downloads/FormExp.zip
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.