paulthepaddy
Well-known member
hey all this is confusing lol and im not sure if what i want is possable but we will see
i have a class called car and within that class i have a few vairables
i want to be able to call the variales through a variable for example
Combobox currentcar holds a list(of Car)
combobox SSr holds a service
so the values being passed to the sub would be
turning the sub into this
i hope this makes sense
i have a class called car and within that class i have a few vairables
VB.NET:
Public Class car
Public Property Name As String
Public Property ID As Byte
Public Make As String
Public Model As String
Public Colour As String
Public Reg As String
Public FullDamageList As List(Of String) = New List(Of String)
#Region "Car Totals: SUB, TOTAL,DIS, ADD Finished"
Public Subtotal As Char
Public Discount As Char
Public additional As Char
Public Total As Char
Public finished As Boolean = False
#End Region
#Region "SSR Lists & Price Variables"
Public SSR_ScratchDamage As List(Of String) = New List(Of String)
Public SSR_ScratchPrice As Short = 0
Public SSR_StoneChipDamage As List(Of String) = New List(Of String)
Public SSR_StoneChipPrice As Short = 0
Public SSR_WalkaroundDamage As String
Public SSR_WalkaroundPrice As Byte = 0
#End Region
#Region "Spray Lists & Price Variables"
Public Spray_StandardDamage As List(Of String) = New List(Of String)
Public Spray_StandardPrice As Short = 0
Public Spray_ParkingSensorsDamage As String
Public Spray_ParkingSensorsPrice As Byte = 0
Public Spray_WingMirrorDamage As List(Of String) = New List(Of String)
Public Spray_WingMirrorPrice As Byte = 0
Public Spray_DoorMouldingDamage As List(Of String) = New List(Of String)
Public Spray_DoorMouldingPrice As Integer = 0
#End Region
#Region "Fiber List & Price Variables"
Public Fiber_CigaretteBurnDamage As List(Of String) = New List(Of String)
Public Fiber_CigaretteBurnPrice As Short = 0
Public Fiber_TornFabricDamage As List(Of String) = New List(Of String)
Public Fiber_TornFabricPrice As Short = 0
Public Fiber_WornFabricDamage As List(Of String) = New List(Of String)
Public Fiber_WornFabricPrice As Short = 0
Public Fiber_CigaretteBurninCarpetDamage As List(Of String) = New List(Of String)
Public Fiber_CigaretteBurninCarpetPrice As Short = 0
Public Fiber_TearinCarpetDamage As List(Of String) = New List(Of String)
Public Fiber_TearinCarpetPrice As Short = 0
#End Region
#Region "Aroma"
Public Aroma_Damage As String
Public Aroma_Price As Byte = 0
#End Region
#Region "Glass Lists & Price"
Public Glass_ScratcheDamage As List(Of String) = New List(Of String)
Public Glass_ScratchePrice As Byte = 0
Public Glass_ChipDamage As List(Of String) = New List(Of String)
Public Glass_ChipPrice As Byte = 0
#End Region
i want to be able to call the variales through a variable for example
VB.NET:
Public sub Load_List_And_Price (SelectCar as Car, List as String, Price as string)
list = list & "Damage"
Price = Price & "Price"
for each item in selectcar.list
damage_list.item.add(list)
next
num_Subtotal.value = selectcar.price
end sub
VB.NET:
Call Load_List_And_Price(Combobox_CurrentCar, Combobox_SSR.SelectedText,Combobox_SSR.SelectedText)
Combobox currentcar holds a list(of Car)
combobox SSr holds a service
so the values being passed to the sub would be
VB.NET:
Call Load_List_And_Price(Car1, SSR_Scratch,SSR_Scratch)
turning the sub into this
VB.NET:
list = list & "Damage"
Price = Price & "Price"
for each item in Car1.SSR_ScratchDamage
damage_list.item.add(list)
next
num_Subtotal.value = Car1.SSR_Scratch.price
end sub
i hope this makes sense