Jump to content
  • Advertisement
Sign in to follow this  
Marz

VB6 Multi form problem

This topic is 5029 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using Visual Basic 6 to create a character generator for an RPG. The characters are generated on the first forum. Once the person selects the stats he likes he presses continue which loads forum2. The continue button holds the code that transfers the stats from form 1 to form 2. My problem is that I want to display a variables value in a text box on form 2 but when the button is pressed it will not load. It is strange as the stats load fine using form2.txtstrength2 = strength.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Marz
I am using Visual Basic 6 to create a character generator for an RPG. The characters are generated on the first forum. Once the person selects the stats he likes he presses continue which loads forum2. The continue button holds the code that transfers the stats from form 1 to form 2.

My problem is that I want to display a variables value in a text box on form 2 but when the button is pressed it will not load. It is strange as the stats load fine using form2.txtstrength2 = strength.


Try this, it should work.


form2.txtstrength.text = strength







Notice you'd missed out the .text

Or have I misunderstood you, and the other form won't load at all? Or is it just the value doesn't appear in the textbox? I'm confused, but hope what I put up there helps you in some way or another.

Share this post


Link to post
Share on other sites
Sorry my bad. I have the strength and other stats working using

form2.txtstrength.text = strength.

The variable that won't load is called Aad I have it declared as dim Aad as Integer, initialized Aad = 4 but when I try and store it in a text box named abilityadjust as so form2.abilityadjust.text = Aad it does not appear. Form2 loads fine and displays all the stats


What if I made an invisible command button on form2 to put the ability adjust code under and then put code under the continue button on form1 that clicks the invisible command button?

There is no click command but I think it would be Form2.inviscommand.Value = True

Is this correct?

I'm not sude how to do this but

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!