Click here to download interface
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 table
{
public partial
class Form1
: Form
{
public Form1()
{
InitializeComponent();
}
private void
button1_Click(object sender, EventArgs e)
{
string
str = "";
int
n = Convert.ToInt32(textBox1.Text);
for
(int i = 1; i <= 10; i++)
{
int
s = 0;
s=n* i;
str = str + n.ToString() + " X " + i.ToString() + " = " + (n * i) + "\n";
richTextBox1.Text = str;
}
}
private void
textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if
(!(e.KeyChar >= 48 && e.KeyChar <= 57 || e.KeyChar==8))
{
e.Handled = true;
}
}
private void
button3_Click(object sender, EventArgs e)
{
textBox1.Text = "";
richTextBox1.Text = "";
}
private void
button2_Click(object sender, EventArgs e)
{
Close();
}
}
}
No comments:
Post a Comment