using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
numericUpDown1.Maximum = 10;
numericUpDown1.Minimum = 1;
numericUpDown1.Value = 1;
}
private void button1_Click(object sender, EventArgs e)
{
for (int init = 1; init <= (int)numericUpDown1.Value; init++);
TextBox textBoxChamp = new TextBox();
textBoxChamp.Location = new Point(40, 70);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
TextBox textBoxChamp = new TextBox();
textBoxChamp.Location = new Point(40, 70);
}
}
}
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question//si tu es certain que l'utilisateur tapera bien toujours un nombre NumericUpDown1.Value = (decimal)TextBox1.Text; //ou NumericUpDown1.Value = Convert.ToDecimal(TextBox1.Text); //si tu as un doute quand au fait que l'utilisateur ne mettra jamais une lettre ou un caractère inapproprié decimal nombre; If (decimal.TryParse(TextBox1.Text, out nombre)) NumericUpDown1.Value = nombre;