I posted this in the wrong forum before, hopefully someone deletes it.
I need to have this program display rental rates in a listbox when a button is pressed, and then allow the user to select which item they want to rent and if it's for a full day or a half day. When you click the "bill" button it should automatically enter a $30 deposit as well as the item you rented, and how much it is based on a full or half day rental.
For now, is it alright for me to just hard code the rental rates into the first listbox or must I have them be read from a text file? I don't like doing that much but I'm not sure if I can then have the bill reflect the choices that are picked without having it read them from a file. Is it still fairly easy to get the bill totaled up this way, by using if statements or maybe the case statements? I haven't written the function for determining the bill yet. Here is my sample code for the first listbox.
And this is the way the program looks when it is run just so you can get a better idea what I'm talking about.Code:Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click With lstRates.Items .Add("Price of Equipment " & "Half-day " & "Full-Day") .Add("1. " & "Rug cleaner " & "$16.00 " & "$24.00") .Add("2. " & "Lawn mower " & "$12.00 " & "$18.00") .Add("3. " & "Paint sprayer " & "$20.00 " & "$30.00") End With End Sub End Class
![]()




Reply With Quote