1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox_mois.SelectedIndexChanged
If Me.Label_mt_abo.Text = Nothing Then
MsgBox("N'oublier pas de selectionner une puissance de compteur et un type d'abonnement ", MsgBoxStyle.OkOnly)
Else
'resulat arrondi a 2 decimal
Select Case Me.ComboBox_mois.SelectedIndex
Case 0
'resultat pour un mois par rapport au montant abonnement annuel
Me.Label_mt_abo.Text = Math.Round(CDbl(Me.Label_mt_abo.Text / 12), 2)
Case 1
'pour 2 mois
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 2), 2)
Case 2
'pour 3 mois ....
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 3), 2)
Case 3
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 4), 2)
Case 4
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 5), 2)
Case 5
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 6), 2)
Case 6
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 7), 2)
Case 7
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 8), 2)
Case 8
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 9), 2)
Case 9
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 10), 2)
Case 10
Me.Label_mt_abo.Text = Math.Round(CDbl((Me.Label_mt_abo.Text / 12) * 11), 2)
Case 11
Me.Label_mt_abo.Text = Math.Round(CDbl(Me.Label_mt_abo.Text), 2)
End Select
End If
End Sub |
Partager