How does one access the elements of a SortedList? The ‘ .Contains’ property does the locating but the second element ‘ .Item’ property yields an error message BC30512: Option Strict On disallows implicit conversions from 'Object' to 'Decimal'. Is there another property to replace the '.Item'?
All of the sample coding I research do not address the second element [Capacity, Count, Add, Clear, Contains,ContainsValue, Item(key), Remove(Key) and RemoveAT(Index)]. TIA JP
Code:Private PovertyGuidelines As SortedList Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Create Guidelines and intialize beginning values. PovertyGuidelines = New SortedList From {{"1", "10210"}, {"2", "13690"}, {"3", "17170"}, {"4", "20650"}, {"5", "24130"}, {"6", "27610"}, {"7", "31090"}, {"8", "34570"}, {"9", "38050"}, {"10", "41530"}, {"11", "45010"}, {"12", "48490"}} End Sub If PovertyGuidelines.Contains(IndividualHousehold.FamilySize) Then PovertyLevelDecimal = PovertyGuidelines.Item(IndividualHousehold.FamilySize) If PovertyLevelDecimal >= IndividualHousehold.IncomeSize Then




Reply With Quote
