Results 1 to 21 of 21

Thread: combo box!!! >:(

Threaded View

  1. #9
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: combo box!!! >:(

    You have to loop through... in that event.. for every object in your arraylist... and I dont see where you have the object name as part of the object???
    VB Code:
    1. 'in your changed event, just hand-coded using guesses of your code...
    2. For Each Obj as MyObject in MyObjects
    3.       If Cstr(Obj.CompanyName) = cboCompanyName.Text then '<-- MyObject.CompanyName is the company text of your object, didnt see that in the code above?
    4.              txtPDate.Text = CStr(Obj.PurchaseDate())
    5.              txtShares.Text = CStr(Obj.Shares)
    6.              txtPPrice.Text = CStr(FormatCurrency(Obj.PurchasePrice()))
    7.              txtTValue.Text = FormatCurrency(Obj.TotalValue())
    8.              txtWorth.Text = CStr(FormatPercent(Obj.TotalValue() / Obj.TotalValue()))
    9.              Exit For
    10.       End If
    11. Next
    *also, all of the CStr shouldnt be necessary. If they are already a string, no need to cast them into a string. For the ones you need to cast, you can use just .ToString()
    Last edited by gigemboy; Jan 25th, 2006 at 12:45 AM.

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