Archived

This topic is now archived and is closed to further replies.

Nanven

VB.NET: Form question

Recommended Posts

Is there any way I can get formb to change forma''s controls? I as trying something like: Dim instanceFormA As new forma() instanceFormA.myInteger = 0 ''myInteger is public But it didn''t chance anything. so is it possible to change forma with formb? What i''m really trying to accomplish here is, if i do this: Dim instanceFormB as new formb() instanceFormB.Show() in a button and keep clicking it, i got a billion windows. I only want it to run if that form is not open, so is there another way to check if the form is loaded or not? Otherwise i was using an integer inside forma and if its 0, load formb, and then change it to 1, now im trying to when formb is closed set the int in forma to 0, so it knows its unloaded. I hope this isn''t confusing, heh.

Share this post


Link to post
Share on other sites
Basically, any time you do new formb you create a new form - if you organize your code like this:
inside form a:

Dim instanceFormB as new formb() '' not in a method

''in a method (a button for example)
instanceFormB.Show()

you should get the desired results.

"I woke up sweating and clutching my pillow. Thankfully the powerful and reassuring visage of Optimus Prime staring back at me from my pillow case served to ease my frayed nerves. Like the giant robotic father I never had he always knows just what to say" - Gabe, Penny-Arcade

Alexandre Moura

Share this post


Link to post
Share on other sites