Ana Sayfa  |  Forum  |  Yardım  |  Üyeler  |  Giriş  |  Kayıt
Yeni Başlık  Cevap Yaz
Uygulama 1 - Basit Hesap Makinesi           (gösterim sayısı: 247)
Yazan Konu içeriği

boşluk

Servet
[Servet]
Kurucu

.

Kayıt Tarihi: 06.12.2019
İleti Sayısı: 22
Konum: internet
Durum: Forumda Değil

E-Posta Gönder
Web Sitesi
Özel ileti Gönder

Konu Yazan: Servet
Konu Tarihi: 08.06.2020-20:44:32


[ Bağlantıları görmek için üye ol veya giriş yap ]

Not: namespace değerinizi kendi projenize göre değiştirmeyi unutmayınız.

Form1.cs kodları
Kod Çizelgesi: C#[Hepsini Seç] 

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 BasitHesapMakikesi
{
    public partial class Form1 Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        double sayisonuc;
        string opt,islem;
        bool optBool=false;
        private void Form1_Load(object senderEventArgs e)
        {
            SonucLbl.Text=IslemLbl.Text "";
        }



        private void rakamlar(object senderEventArgs e)
        {
            Button b = (Button)sender;
            SayiTxt.Text += b.Text;
            optBool true;
        }

        private void IslemBtn(object senderEventArgs e)
        {
            Button b = (Button)sender;


            if (!string.IsNullOrEmpty(opt) &&ampoptBool==true)
            {
               
                switch (opt)
                {
                    case "+":
                        sonuc += sayi;
                        break;
                    case "-":
                        sonuc -= sayi;
                        break;
                    case "*":
                        sonuc *= sayi;
                        break;
                    case "/":
                        sonuc /= sayi;
                        break;
                }
                islem +=" "opt+" " sayi;
            }
            else
            {
                if (IslemLbl.Text == "")
                {
                    if (optBool == false)
                    {
                        sonuc 0;
                        islem IslemLbl.Text "";
                    }
                    else
                    {
                        sonuc sayi;
                        islem IslemLbl.Text sayi "";
                    }
                }
            }
            optBool false;
           
          
            IslemLbl.Text islem " " b.Text;


           
            opt b.Text;
            SayiTxt.Text "";
            SonucLbl.Text sonuc+"";

            if (opt == "=")
            {
                sayi sonuc;
                islem sayi "";
                opt "";
            }
        }

        private void SayiTxt_TextChanged(object senderEventArgs e)
        {
            try
            {
                sayi double.Parse(SayiTxt.Text);
            }
            catch (Exception ex)
            {
                if(SayiTxt.Text!="")
                MessageBox.Show("Girilen değer bir sayı değildir");
            }
        }

        private void button16_Click(object senderEventArgs e)
        {
            //C
            SonucLbl.Text IslemLbl.Text "";
            SayiTxt.Text "";
            sayi 0;
            sonuc 0;
            opt "";
        }

        private void button17_Click(object senderEventArgs e)
        {
            //CE
            SayiTxt.Text "";
        }

        private void button19_Click(object senderEventArgs e)
        {
            //<--

            string tmp SayiTxt.Text;
            string tmp1="";
            for (int i 0tmp.Length -i++)
                tmp1 += tmp<i>.ToString();

            SayiTxt.Text tmp1;
        }

    }
}</i>





Form1.Designer.cs kodları
[ Bağlantıları görmek için üye ol veya giriş yap ]

Kod Çizelgesi: C#[Hepsini Seç] 

namespace BasitHesapMakikesi
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing &amp;&amp; (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button16 = new System.Windows.Forms.Button();
            this.button17 = new System.Windows.Forms.Button();
            this.button18 = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.button4 = new System.Windows.Forms.Button();
            this.button15 = new System.Windows.Forms.Button();
            this.button5 = new System.Windows.Forms.Button();
            this.button14 = new System.Windows.Forms.Button();
            this.button6 = new System.Windows.Forms.Button();
            this.button13 = new System.Windows.Forms.Button();
            this.button7 = new System.Windows.Forms.Button();
            this.button12 = new System.Windows.Forms.Button();
            this.button8 = new System.Windows.Forms.Button();
            this.button11 = new System.Windows.Forms.Button();
            this.button9 = new System.Windows.Forms.Button();
            this.button10 = new System.Windows.Forms.Button();
            this.SayiTxt = new System.Windows.Forms.TextBox();
            this.IslemLbl = new System.Windows.Forms.Label();
            this.SonucLbl = new System.Windows.Forms.Label();
            this.button19 = new System.Windows.Forms.Button();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // button16
            // 
            this.button16.Location = new System.Drawing.Point(1917);
            this.button16.Name "button16";
            this.button16.Size = new System.Drawing.Size(3739);
            this.button16.TabIndex 17;
            this.button16.Text "C";
            this.button16.UseVisualStyleBackColor true;
            this.button16.Click += new System.EventHandler(this.button16_Click);
            // 
            // button17
            // 
            this.button17.Location = new System.Drawing.Point(6217);
            this.button17.Name "button17";
            this.button17.Size = new System.Drawing.Size(3739);
            this.button17.TabIndex 18;
            this.button17.Text "CE";
            this.button17.UseVisualStyleBackColor true;
            this.button17.Click += new System.EventHandler(this.button17_Click);
            // 
            // button18
            // 
            this.button18.Location = new System.Drawing.Point(105195);
            this.button18.Name "button18";
            this.button18.Size = new System.Drawing.Size(3739);
            this.button18.TabIndex 19;
            this.button18.Text ",";
            this.button18.UseVisualStyleBackColor true;
            this.button18.Click += new System.EventHandler(this.rakamlar);
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.button19);
            this.panel1.Controls.Add(this.button18);
            this.panel1.Controls.Add(this.button17);
            this.panel1.Controls.Add(this.button16);
            this.panel1.Controls.Add(this.button1);
            this.panel1.Controls.Add(this.button2);
            this.panel1.Controls.Add(this.button3);
            this.panel1.Controls.Add(this.button4);
            this.panel1.Controls.Add(this.button15);
            this.panel1.Controls.Add(this.button5);
            this.panel1.Controls.Add(this.button14);
            this.panel1.Controls.Add(this.button6);
            this.panel1.Controls.Add(this.button13);
            this.panel1.Controls.Add(this.button7);
            this.panel1.Controls.Add(this.button12);
            this.panel1.Controls.Add(this.button8);
            this.panel1.Controls.Add(this.button11);
            this.panel1.Controls.Add(this.button9);
            this.panel1.Controls.Add(this.button10);
            this.panel1.Location = new System.Drawing.Point(12112);
            this.panel1.Name "panel1";
            this.panel1.Size = new System.Drawing.Size(241261);
            this.panel1.TabIndex 20;
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(1962);
            this.button1.Name "button1";
            this.button1.Size = new System.Drawing.Size(3739);
            this.button1.TabIndex 2;
            this.button1.Text "7";
            this.button1.UseVisualStyleBackColor true;
            this.button1.Click += new System.EventHandler(this.rakamlar);
            // 
            // button2
            // 
            this.button2.Location = new System.Drawing.Point(19107);
            this.button2.Name "button2";
            this.button2.Size = new System.Drawing.Size(3739);
            this.button2.TabIndex 3;
            this.button2.Text "4";
            this.button2.UseVisualStyleBackColor true;
            this.button2.Click += new System.EventHandler(this.rakamlar);
            // 
            // button3
            // 
            this.button3.Location = new System.Drawing.Point(10562);
            this.button3.Name "button3";
            this.button3.Size = new System.Drawing.Size(3739);
            this.button3.TabIndex 4;
            this.button3.Text "9";
            this.button3.UseVisualStyleBackColor true;
            this.button3.Click += new System.EventHandler(this.rakamlar);
            // 
            // button4
            // 
            this.button4.Location = new System.Drawing.Point(6262);
            this.button4.Name "button4";
            this.button4.Size = new System.Drawing.Size(3739);
            this.button4.TabIndex 5;
            this.button4.Text "8";
            this.button4.UseVisualStyleBackColor true;
            this.button4.Click += new System.EventHandler(this.rakamlar);
            // 
            // button15
            // 
            this.button15.Location = new System.Drawing.Point(148150);
            this.button15.Name "button15";
            this.button15.Size = new System.Drawing.Size(3739);
            this.button15.TabIndex 16;
            this.button15.Text "+";
            this.button15.UseVisualStyleBackColor true;
            this.button15.Click += new System.EventHandler(this.IslemBtn);
            // 
            // button5
            // 
            this.button5.Location = new System.Drawing.Point(105150);
            this.button5.Name "button5";
            this.button5.Size = new System.Drawing.Size(3739);
            this.button5.TabIndex 6;
            this.button5.Text "3";
            this.button5.UseVisualStyleBackColor true;
            this.button5.Click += new System.EventHandler(this.rakamlar);
            // 
            // button14
            // 
            this.button14.Location = new System.Drawing.Point(148107);
            this.button14.Name "button14";
            this.button14.Size = new System.Drawing.Size(3739);
            this.button14.TabIndex 15;
            this.button14.Text "-";
            this.button14.UseVisualStyleBackColor true;
            this.button14.Click += new System.EventHandler(this.IslemBtn);
            // 
            // button6
            // 
            this.button6.Location = new System.Drawing.Point(62150);
            this.button6.Name "button6";
            this.button6.Size = new System.Drawing.Size(3739);
            this.button6.TabIndex 7;
            this.button6.Text "2";
            this.button6.UseVisualStyleBackColor true;
            this.button6.Click += new System.EventHandler(this.rakamlar);
            // 
            // button13
            // 
            this.button13.Location = new System.Drawing.Point(14862);
            this.button13.Name "button13";
            this.button13.Size = new System.Drawing.Size(3739);
            this.button13.TabIndex 14;
            this.button13.Text "*";
            this.button13.UseVisualStyleBackColor true;
            this.button13.Click += new System.EventHandler(this.IslemBtn);
            // 
            // button7
            // 
            this.button7.Location = new System.Drawing.Point(19150);
            this.button7.Name "button7";
            this.button7.Size = new System.Drawing.Size(3739);
            this.button7.TabIndex 8;
            this.button7.Text "1";
            this.button7.UseVisualStyleBackColor true;
            this.button7.Click += new System.EventHandler(this.rakamlar);
            // 
            // button12
            // 
            this.button12.Location = new System.Drawing.Point(14817);
            this.button12.Name "button12";
            this.button12.Size = new System.Drawing.Size(3739);
            this.button12.TabIndex 13;
            this.button12.Text "/";
            this.button12.UseVisualStyleBackColor true;
            this.button12.Click += new System.EventHandler(this.IslemBtn);
            // 
            // button8
            // 
            this.button8.Location = new System.Drawing.Point(105107);
            this.button8.Name "button8";
            this.button8.Size = new System.Drawing.Size(3739);
            this.button8.TabIndex 9;
            this.button8.Text "6";
            this.button8.UseVisualStyleBackColor true;
            this.button8.Click += new System.EventHandler(this.rakamlar);
            // 
            // button11
            // 
            this.button11.Location = new System.Drawing.Point(148195);
            this.button11.Name "button11";
            this.button11.Size = new System.Drawing.Size(3739);
            this.button11.TabIndex 12;
            this.button11.Text "=";
            this.button11.UseVisualStyleBackColor true;
            this.button11.Click += new System.EventHandler(this.IslemBtn);
            // 
            // button9
            // 
            this.button9.Location = new System.Drawing.Point(62107);
            this.button9.Name "button9";
            this.button9.Size = new System.Drawing.Size(3739);
            this.button9.TabIndex 10;
            this.button9.Text "5";
            this.button9.UseVisualStyleBackColor true;
            this.button9.Click += new System.EventHandler(this.rakamlar);
            // 
            // button10
            // 
            this.button10.Location = new System.Drawing.Point(19195);
            this.button10.Name "button10";
            this.button10.Size = new System.Drawing.Size(8039);
            this.button10.TabIndex 11;
            this.button10.Text "0";
            this.button10.UseVisualStyleBackColor true;
            this.button10.Click += new System.EventHandler(this.rakamlar);
            // 
            // SayiTxt
            // 
            this.SayiTxt.Location = new System.Drawing.Point(1250);
            this.SayiTxt.Name "SayiTxt";
            this.SayiTxt.Size = new System.Drawing.Size(24120);
            this.SayiTxt.TabIndex 1;
            this.SayiTxt.TextChanged += new System.EventHandler(this.SayiTxt_TextChanged);
            // 
            // IslemLbl
            // 
            this.IslemLbl.AutoSize true;
            this.IslemLbl.Location = new System.Drawing.Point(3320);
            this.IslemLbl.Name "IslemLbl";
            this.IslemLbl.Size = new System.Drawing.Size(3513);
            this.IslemLbl.TabIndex 0;
            this.IslemLbl.Text "label1";
            // 
            // SonucLbl
            // 
            this.SonucLbl.AutoSize true;
            this.SonucLbl.Location = new System.Drawing.Point(21820);
            this.SonucLbl.Name "SonucLbl";
            this.SonucLbl.Size = new System.Drawing.Size(3513);
            this.SonucLbl.TabIndex 21;
            this.SonucLbl.Text "label1";
            // 
            // button19
            // 
            this.button19.Location = new System.Drawing.Point(10517);
            this.button19.Name "button19";
            this.button19.Size = new System.Drawing.Size(3739);
            this.button19.TabIndex 20;
            this.button19.Text "<--";
            this.button19.UseVisualStyleBackColor true;
            this.button19.Click += new System.EventHandler(this.button19_Click);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F13F);
            this.AutoScaleMode System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(309400);
            this.Controls.Add(this.SonucLbl);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.SayiTxt);
            this.Controls.Add(this.IslemLbl);
            this.Name "Form1";
            this.Text "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button button16;
        private System.Windows.Forms.Button button17;
        private System.Windows.Forms.Button button18;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button4;
        private System.Windows.Forms.Button button15;
        private System.Windows.Forms.Button button5;
        private System.Windows.Forms.Button button14;
        private System.Windows.Forms.Button button6;
        private System.Windows.Forms.Button button13;
        private System.Windows.Forms.Button button7;
        private System.Windows.Forms.Button button12;
        private System.Windows.Forms.Button button8;
        private System.Windows.Forms.Button button11;
        private System.Windows.Forms.Button button9;
        private System.Windows.Forms.Button button10;
        private System.Windows.Forms.TextBox SayiTxt;
        private System.Windows.Forms.Label IslemLbl;
        private System.Windows.Forms.Label SonucLbl;
        private System.Windows.Forms.Button button19;

    }
}






Bu ileti en son Servet tarafından 08.06.2020-20:53:28 tarihinde, toplamda 3 kez değiştirilmiştir.
Yeni Başlık  Cevap Yaz



Forum Ana Sayfa

 Bu konuyu 0 kişi görüntülüyor:  0 Misafir, 0 Üye
 Bu konuyu görüntüleyen üye yok.
Benzer konular
Başlık Yazan Cevap Gösterim Son ileti
Benzer konu yok
Etiketler   Uygulama,   Basit,   Hesap,   Makinesi
Kızıl Ejder Forumu
Forum Mobil RSS