Friday, July 31, 2009

How do I make a variable usable in multiple forms in Visual Basic 6?

Let say in Form1 the user chooses a text file, file A, to open containing the path of another file, file B. Then he will click a command button which opens file B in another form, displaying the text in the file in a text box.

How do I make a variable usable in multiple forms in Visual Basic 6?
don't understand the question





do you mean file A contains the path to file B ?
Reply:There are three ways of doing this.





When you Define Form 2, set the Tag command with the value.





or





When you define Form 2 put the value in the New Parameters list





or





Define the Variable as Public in Form 2, after it is defined move the value to the variable.
Reply:You will find the answer here





http://www.freetutes.com/VisualBasic
Reply:Use a module. A module in VB6 is essentially common code that can be referenced by all classes %26amp; forms within your project.


No comments:

Post a Comment