Results 1 to 3 of 3

Thread: Communication between forms

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Communication between forms

    I'm designing a program that will display share quotes and share information. Currently I have my main form and 2 additional forms (frmStockQuotes and frmStockInfo). The main form, every 30 seconds will go off to a website and get the share quotes and information for all the stocks listed in frmStockQuotes and frmStockInfo.

    My issue/question is, how to I pass all the stock codes from frmStockQuotes and/or frmStockInfo to my main form and once received from both (or one if only one of the forms are open) go off and get all the info from the web? Once all the info is retrieved how would I pass the info back to each form?

    Once I have this example complete I will be adding additional forms which will do the same thing so I could have 10 forms open that all need to send their stock lists back to the main form before the share info is retrieved.

    Any help would be appreciated

  2. #2

  3. #3
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    739

    Re: Communication between forms

    I think I'd create a class with public properties. each of the stocks has similar properties such as the ticker, Last Trade, PrevClose, Open, Bid, Ask etc etc.

    Programmitically you'd then create an array of Stocks and you could read and write to them like this:-

    myStock[i].ticker = "RIO.L";
    myStock[i].LastTrade = 4047.50;
    myStock[i].Open = 4070.00
    etc. etc.

    Because they're in a public class you could get at them from any form.

    or something like that

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