×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

hi everybody ! i am facing one problem in microsoft visual basic 4.0

hi everybody ! i am facing one problem in microsoft visual basic 4.0

hi everybody ! i am facing one problem in microsoft visual basic 4.0

(OP)
hi everybody !
i am facing one problem in microsoft visual basic 4.0
(32 bit) here it is.....

Form1 having array of text box controls with numbers inside it and facility to Add OR Remove controls and
Also, buttons OK and CANCEL are there.

WHEN I CLICK OK IT SHOULD CREATE ARRAY OF, NUMBERS I TYPED
IN TEXT BOX CONTROL ON FORM2 WHICH IS MY ANOTHER FORM.

WHEN I RELOAD FORM1 AFTER CLICKING CANCEL IT SHOULD LOAD
THE PREVIOUS NUMBER OF CONTROLS ALONG WITH THEIR RELEVANT
VALUES WHATEVER IS IT.

can we use arrays like public variable

if possible mail me at : makarand.patil@usa.net
with some example code

Thanks

makarand m. patil

Replies continue below

Recommended for you

RE: hi everybody ! i am facing one problem in microsoft visual basic 4.0

Hi makarandpatil !

Yes, you need to separate the data from it's presentation (the forms). I would do something like create a class module with public properties of:
-- Control Size (x,y,cx,cy)
-- Control Value

I would then create a .bas module that contains an instance of a global collection.

As the user adds/removes controls on Form1, also add and remove members of the collection. The members being, of course, instances of your class.

When it comes time to show Form2, and all the values from Form1, you can just do a For..Each loop through the collection, adding the .Value property to the textbox.

When the user clicks 'Cancel' on Form2, to go back to Form1, you again loop through the collection, using the control size info to recreate the control array, and stuff the .Value into the controls.

By separating the data from the view of the data, you make things much more flexible, and easier to add features later.

Chip H.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close