AHMET MERT TUNÇ
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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int a, b = 0;
int alan = 0;
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
textBox1.Visible = true;
textBox2.Visible = false;
textBox3.Visible = false;
textBox5.Visible = false;
textBox6.Visible = false;
}
void daire()
{
alan = (b * b) * a;
listBox1.Items.Add(alan);
}
void üçgen()
{
alan = (a * b) / 2;
listBox1.Items.Add(alan);
}
void dik()
{
alan = a * b;
listBox1.Items.Add(alan);
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
textBox1.Visible = false;
textBox2.Visible = true;
textBox3.Visible = true;
textBox5.Visible = false;
textBox6.Visible = false;
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
textBox1.Visible = false;
textBox2.Visible = false;
textBox3.Visible = false;
textBox5.Visible = true;
textBox6.Visible = true;
}
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
a=3;
b=Convert.ToInt32(textBox1.Text);
daire();
}
if (radioButton2.Checked)
{
a = Convert.ToInt32(textBox2.Text);
b = Convert.ToInt32(textBox3.Text);
üçgen();
}
if (radioButton3.Checked)
{
a = Convert.ToInt32(textBox5.Text);
b = Convert.ToInt32(textBox6.Text);
dik();
}
}
}
}
Hiç yorum yok:
Yorum Gönder