Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The level of expertise is awesome. The nature in which people respond is professional helpful and not the least condescending. I can't say that for most forums..."

Geography

Where in the world do Tek-Tips members come from?

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

makarandpatil (Programmer)
16 Aug 99 0:37
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

chiph (Programmer)
16 Aug 99 9:27
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.

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!

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