Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Visual Basic (2005 Express)


  • Please log in to reply
3 replies to this topic

#1 thisismydisplayname

thisismydisplayname

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:30 AM

Posted 31 March 2008 - 10:04 PM

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.)

Edited by thisismydisplayname, 31 March 2008 - 10:23 PM.


BC AdBot (Login to Remove)

 


#2 raw

raw

    Bleeping Hacker


  • Members
  • 2,577 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Texas
  • Local time:01:30 AM

Posted 01 April 2008 - 06:10 PM

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.

rawsig.png

 rawcreations.net          @raw_creations


Current systems: WHAT OS, BackTrack-raw, PCLinuxOS, Peppermint OS 6, Kali Linux

and a custom Linux From Scratch server hosting a bunch of top secret stuff.


#3 thisismydisplayname

thisismydisplayname
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:30 AM

Posted 07 April 2008 - 03:23 PM

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?

#4 raw

raw

    Bleeping Hacker


  • Members
  • 2,577 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Texas
  • Local time:01:30 AM

Posted 07 April 2008 - 07:30 PM

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

Edited by raw, 07 April 2008 - 08:27 PM.

rawsig.png

 rawcreations.net          @raw_creations


Current systems: WHAT OS, BackTrack-raw, PCLinuxOS, Peppermint OS 6, Kali Linux

and a custom Linux From Scratch server hosting a bunch of top secret stuff.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users