Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21292

List Box problem

$
0
0
Hello everyone, I am currently a student learning Visual Basic (using MS visual studio express 2013) and I have run into a problem with using list boxes and I can't seem to find what it is. Any help is appreciated.

Problem 1

Code:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim ctxt, holtxt, copstxt As Integer
        holtxt = (holtxt * 35)
        copstxt = copstxt + (copstxt * 0.5)
        Bill.Items.Add("Customer" & ctxt)
        Bill.Items.Add("Labor Cost" & holtxt)
        Bill.Items.Add("Parts Cost" & copstxt)
        Bill.Items.Add("Total Cost" & (holtxt + copstxt))
    End Sub
End Class

Problem 2

Code:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim milestxt, yardstxt, feettxt, inchestxt, totalinches, totalmeters, kilometers, totalcent As Integer
        totalinches = (63360 * milestxt + 36 * yardstxt + 12 * feettxt + inchestxt)
        totalmeters = inchestxt / 39.37
        kilometers = Int(totalmeters / 1000)
        totalcent = totalinches * 2.54
        Metric.Items.Add("The Metric length is")
        Metric.Items.Add(kilometers & "Kilometers")
        Metric.Items.Add(totalmeters & "Meters")
        Metric.Items.Add(totalcent & "Centimeters")
    End Sub
End Class


Viewing all articles
Browse latest Browse all 21292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>