c# windowsform
Because of school I should use do windows for c# programming, next week first midterm! an example of this week ->
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 csharpForm
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void btnEnter_Click(object sender, EventArgs e)
{
switch(int.Parse(txtSayi.Text))
{
case 1:
txtColor.BackColor=System.Drawing.Color.Red;
break;
case 2:
txtColor.BackColor=System.Drawing.Color.Yellow;
break;
case 3:
txtColor.BackColor=System.Drawing.Color.Blue;
break;
case 4:
txtColor.BackColor = System.Drawing.Color.BlueViolet;
break;
case 5:
txtColor.BackColor = System.Drawing.Color.Brown;
break;
case 6:
txtColor.BackColor = System.Drawing.Color.CadetBlue;
break;
case 7:
txtColor.BackColor = System.Drawing.Color.CornflowerBlue;
break;
case 8:
txtColor.BackColor = System.Drawing.Color.DarkMagenta;
break;
case 9:
txtColor.BackColor = System.Drawing.Color.Black;
break;
case 10:
txtColor.BackColor = System.Drawing.Color.Green;
break;
default:
MessageBox.Show("sayi [1,10] araliginda olmali!");
break;
}
}
private void btnHesapla_Click(object sender, EventArgs e)
{
MessageBox.Show("Sonuc:" + int.Parse(txtSayi1.Text)*int.Parse(txtSayi2.Text));
}
private void btnAy_Click(object sender, EventArgs e)
{
for (int i = 0; i < int.Parse(txtAy.Text); i++)
{
txtSonuc.Text = txtSonuc.Text + (int.Parse(txtUcret.Text) * (i + 1)).ToString() + Environment.NewLine;
}
}
}
}
DOWNLOAD THE PROJECT