Private Sub CommandButton1_Click() If IsNumeric(TextBox1.Text) True And Int(TextBox1.Text) TextBox1.Text Then 'If TextBox1.Text Is numerical = True Then TextBox1.Text = TextBox1.Text * 2 Else dim attention as VbMsgBoxResult attention = msgbox("Le nombre doit être entier", vbOKOnly, "Erreur") 'msgbox(Prompt, vbOKOnly, [Le nombre doit être entier]) As VbMsgBoxResult End If End Sub
If IsNumeric(TextBox1.Text) True And Int(TextBox1.Text) TextBox1.Text Then
attention = msgbox("Le nombre doit être entier", vbOKOnly, "Erreur")
attention = msgbox("Le nombre doit être entier", vbOKOnly, "Erreur")
attention = msgbox(message", vbOKOnly, entête)
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Char.IsNumber(e.KeyChar) False Then e.Handled True End Sub Private Sub CommandButton1_Click() TextBox1.Text = val(TextBox1.Text) * 2 end sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question