CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Adding arrays between forms

    Hi I've got a form of prices for a company's stock but would like to have another form showing these prices so the user is able to select how many they want, to then produce a text box showing the total, and then go onto produce an invoice.
    I was just wondering how I can make the control arrays in the pricing form, show in the invoice arrays, and then multiply each array with amount needed.
    Each individual text box in the array needs to be multiplied by each individual ammount to then be added all together to produce a total.
    If anyone could help it would be much appreciated.
    Thnx Jon

  2. #2
    Join Date
    Jan 2006
    Posts
    11

    Re: Adding arrays between forms

    what on earth r u talking about?!

  3. #3
    Join Date
    Mar 2005
    Location
    Nottingham, UK
    Posts
    665

    Re: Adding arrays between forms

    There are lots of ways to get values from one form to another; too many to list here in fact. If you have an array of controls on one form, how are these controls getting their data? You could just recreate the method for the array of controls on your second form.

    If you have an identical control array on the second form, you could mirror the values from the first array into the second array with a loop
    Code:
    'on second form
    Dim n as Integer
         For n = LabelArray.Lbound to LabelArray.Ubound
              LabelArray(n) = form1.LabelArray(n)
         next n
    You can pass controls around, you can use global variables, public procedures - the possibilities are endless (almost).
    (\/)
    (-.-)
    (')(')


    Bunny's quest for world domination continues.

  4. #4
    Join Date
    May 2005
    Location
    Sterling Heights, MI
    Posts
    74

    Re: Adding arrays between forms

    Another possibility, and one that I've used on many occasion, is to employ the use of the ParamArray keyword.

    This can be very handy when dealing with controls that are NOT in a control array.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured