5 Mart 2016 Cumartesi

C# Çokgenlerin Alan-Çevresini Hesaplama



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 Cokgen_Hesaplama
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }



        private void button1_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox1.Text,out a);
            double.TryParse(textBox1.Text, out b);
            snc = a * b;
            label6.Text = button1.Text + "= " + snc;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox1.Text, out a);
            double.TryParse(textBox1.Text, out b);
            snc = 2*(a+b);
            label6.Text = button2.Text + "= " + snc;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            double a, snc;
            double.TryParse(textBox4.Text, out a);
            snc = a * a;
            label7.Text = button4.Text + "= " + snc;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            double a, snc;
            double.TryParse(textBox4.Text, out a);
            snc = 4 * a;
            label7.Text = button3.Text + "= " + snc;
        }

        private void button6_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox7.Text, out a);
            double.TryParse(textBox8.Text, out b);
            snc = (a * b)/2;
            label9.Text = button6.Text + "= " + snc;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            double a, b, c, snc;
            double.TryParse(textBox3.Text, out a);
            double.TryParse(textBox5.Text, out b);
            double.TryParse(textBox6.Text, out c);
            snc = a + b + c;
            label9.Text = button5.Text + "= " + snc;
        }

        private void button8_Click(object sender, EventArgs e)
        {
            double r, snc;
            double.TryParse(textBox9.Text, out r);
            snc = Math.PI * r * r;
            label21.Text = button8.Text + "= " + snc;
        }

        private void button7_Click(object sender, EventArgs e)
        {
            double r, snc;
            double.TryParse(textBox9.Text, out r);
            snc = Math.PI * 2 * r;
            label21.Text = button7.Text + "= " + snc;
        }

        private void button10_Click(object sender, EventArgs e)
        {
            double a, h, snc;
            double.TryParse(textBox10.Text, out a);
            double.TryParse(textBox11.Text, out h);
            snc = a * h;
            label28.Text = button10.Text + "= " + snc;
        }

        private void button9_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox10.Text, out a);
            double.TryParse(textBox11.Text, out b);
            snc = (a+b)*2;
            label28.Text = button9.Text + "= " + snc;
        }

        private void cokgenler(object sender, EventArgs e)
        {
            RadioButton buton = (RadioButton)sender;
            if (buton.Text == "Dikdörtgen")
            {
                groupBox2.Visible = true;
                groupBox3.Visible = false;
                groupBox4.Visible = false;
                groupBox5.Visible = false;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Kare")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = true;
                groupBox4.Visible = false;
                groupBox5.Visible = false;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Üçgen")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = false;
                groupBox4.Visible = true;
                groupBox5.Visible = false;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Çember")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = false;
                groupBox4.Visible = false;
                groupBox5.Visible = true;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Paralelkenar")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = false;
                groupBox4.Visible = false;
                groupBox5.Visible = false;
                groupBox6.Visible = true;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label27.Text = "Hazırlayan: Fikri KOCAOĞLAN ";
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label27.Text = label27.Text.Substring(1) + label27.Text.Substring(0, 1);
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com.tr/");
        }
    }
}

Paylaş:

0 yorum:

Yorum Gönder

Popüler

Son

Kategoriler