Re: How can I display a price in a label ?
|
Enrico Oreiton |
|
12/9/2007 9:54:43 PM |
Marianna, pleaseexplain your problem in detail. Post Comments |
|
Re: Many different frames
|
Marienna Lopez |
|
12/9/2007 10:00:39 PM |
Hi Jackil, I have many different frames with a couple of option buttons in each frame. Each option button selects an item worth a particular price. On the bottom of my form, I have a label named "total", which should accumulate the sum of the different prices selected through different option buttons. I would like to display the price in the "total" label when a particular option button is chosen, but without having to click on a button (i.e. the price and sum would be displayed in the label instantly, without having to press a button).
Post Comments |
|
Can you post what you done so far? Post Comments |
|
No :( That's why I'm asking, I don't know how to do it ;)
Post Comments |
|
Re: Click event in option button
|
Enrico Oreiton |
|
12/9/2007 10:06:53 PM |
In optionbutton click event, use
Code: ( vb ) - lblTotal.Caption = optButtonName.Text
Post Comments |
|
Re: Take two frames each having two options groups
|
Dominingo Paitiam |
|
12/9/2007 10:21:27 PM |
Hi If I got ur point and I am correct to ur problem, then take two frames each having two options groups [ Option1 (0) and Option1 (1) ; Option2 (2) and Option2 (3)], two labels - label1 and label2 to show the regarding price of the selected item. Then label3 to show their sum. As follows : Code: ( text ) - Private Sub Form_Load()
-
Option1(0).Value = False -
Option1(1).Value = False -
Option2(2).Value = False -
Option2(3).Value = False -
sum = 0 -
Label3.Caption = Format(sum, "#0.00") - End Sub
- Private Sub Option1_Click(Index As Integer)
-
Select Case Index -
Case 0 -
Label1.Caption = "10.00"
-
Case 1 -
Label1.Caption = "20.00"
-
End Select -
sum = Val(Label1.Caption) + Val(Label2.Caption) -
Label3.Caption = Format(sum, "#0.00") - End Sub
- Private Sub Option2_Click(Index As Integer)
-
Select Case Index -
Case 2 -
Label2.Caption = "30.00"
-
Case 3 -
Label2.Caption = "140.00"
-
End Select -
sum = Val(Label1.Caption) + Val(Label2.Caption) -
Label3.Caption = Format(sum, "#0.00") - End Sub
You can continue, if I got ur point, with the database and several options.
ALL THE BEST! Post Comments |
|
What version of VB are you using? Control arrays aren't available in later versions.
Post Comments |
|