We are doing a simple functions in class and i keep screwing it up.
PrivateSub btncalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalc.Click
Dim snglength, sngwidth, sngheight AsSingle
Dim total AsInteger
'declare varialbes
snglength = Val(Txtlength.Text)
sngwidth = Val(Txtwidth.Text)
sngheight = Val(Txtheight.Text)
'assign txtbox values to variables.
lblvolume.Text =
EndSub
PublicFunction calcvolume(ByVal snglength AsSingle, ByVal sngwidth AsSingle, ByVal sngheight AsSingle, ByVal inttotal AsInteger)
Dim total AsInteger
total = Val(snglength * sngwidth * sngheight)
Return total
EndFunction
it may look worse then before i keep changing things to try and get it to work. basiclly i need to know how i call the value the function is holding back up to display in the label. thank you
if you see anything major wrong please let me know too.
PrivateSub btncalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalc.Click
Dim snglength, sngwidth, sngheight AsSingle
Dim total AsInteger
'declare varialbes
snglength = Val(Txtlength.Text)
sngwidth = Val(Txtwidth.Text)
sngheight = Val(Txtheight.Text)
'assign txtbox values to variables.
lblvolume.Text =
EndSub
PublicFunction calcvolume(ByVal snglength AsSingle, ByVal sngwidth AsSingle, ByVal sngheight AsSingle, ByVal inttotal AsInteger)
Dim total AsInteger
total = Val(snglength * sngwidth * sngheight)
Return total
EndFunction
it may look worse then before i keep changing things to try and get it to work. basiclly i need to know how i call the value the function is holding back up to display in the label. thank you
if you see anything major wrong please let me know too.
Last edited: