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
| namespace Combo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void fct_entree(object sender, KeyPressEventArgs e)
{
cb_attributs.Items.Add(textBox_ajouter.Text);
textBox_ajouter.Text = "";
textBox_ajouter.Focus();
}
private void btn_effacer_Click(object sender, EventArgs e)
{
cb_attributs.Items.Clear();
textBox_ajouter.Text = "";
textBox_ajouter.Focus();
}
void fct_chargement(object sender, EventArgs e)
{
//marche pas ça d'ailleurs, je comprend pas...
textBox_ajouter.Focus();
}
private void fct_controle(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false)
{
MessageBox.Show("Veuillez ne saisir que des lettres.");
textBox_ajouter.Text = "";
return;
}
}
}
} |
Partager