using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace String
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
const int s = 3;
string[] Name = new string[s];
int i = 0;
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsLetter(e.KeyChar) || char.IsControl(e.KeyChar))
{
e.Handled = true;
}
if (e.KeyChar == '\r')
{
Name[i] = txt_EnterName.Text;
i++;
if (i < s)
txt_EnterName.Text = "";
else
{
MessageBox.Show("Enough...");
i = 0;
}
}
}
علاقه مندی ها (Bookmarks)