Lau13 Posted July 12, 2012 at 06:09 PM Report Share #468501 Posted July 12, 2012 at 06:09 PM Boas, Eu tenho uma texbox_1(custo), textbox_2(desconto) e uma label(total a pagar) e gostaria que ao colocar o preço na textbox_1 e ao colocar um desconto na textbox_2 me aparecesse a subtração na label. Caso não tenha desconto que apareça na label o custo que é o valor da textbox_1. Alguem me pode ajudar. Obrigado Link to comment Share on other sites More sharing options...
vg-excel-gest Posted July 12, 2012 at 08:41 PM Report Share #468514 Posted July 12, 2012 at 08:41 PM If TextBox2.Value <> "" Then Label1 = TextBox1.Value * (1 - TextBox2.Value) Else Label1 = TextBox1.Value End If VG-EXCEL-GEST Victor Gamboa vg-excel-gest.blogspot.com/ http://www.youtube.com/user/VGEXCELGEST2?feature=mhum Link to comment Share on other sites More sharing options...
Lau13 Posted July 12, 2012 at 11:52 PM Author Report Share #468524 Posted July 12, 2012 at 11:52 PM Desde já obrigado por me ajudar. Coloco isso onde? na textbox1? Desculpe a pergunta mas ainda sou um pouco leigo. Link to comment Share on other sites More sharing options...
vg-excel-gest Posted July 13, 2012 at 07:44 AM Report Share #468531 Posted July 13, 2012 at 07:44 AM Por exemplo num bt de comando que lhe podes dar o nome "calcular" no modulo privado do formulário: Private Sub CommandButton_Calcular_Click() If TextBox2.Value <> "" Then Label1 = TextBox1.Value * (1 - TextBox2.Value) Else Label1 = TextBox1.Value End If End Sub Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now