Basit Hesap Makinası Programı ve Kodları (C#)
Programın .exe Halini İndirmek İçin Tıklayınız .
Program Kodları :
Form1.Designer.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
namespace WindowsFormsApplication6 { 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 && (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.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.label12 = new System.Windows.Forms.Label(); this.button2 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(26, 34); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(86, 13); this.label1.TabIndex = 0; this.label1.Text = "1. Sayıyı Giriniz : "; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(26, 61); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(86, 13); this.label2.TabIndex = 1; this.label2.Text = "2. Sayıyı Giriniz : "; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(109, 31); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(100, 20); this.textBox1.TabIndex = 2; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(109, 57); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(100, 20); this.textBox2.TabIndex = 3; // // label3 // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.label3.Location = new System.Drawing.Point(28, 228); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(77, 13); this.label3.TabIndex = 4; this.label3.Text = "Toplamları : "; // // label4 // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.label4.Location = new System.Drawing.Point(28, 255); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(61, 13); this.label4.TabIndex = 5; this.label4.Text = "Farkları : "; // // label5 // this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.label5.Location = new System.Drawing.Point(28, 281); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(74, 13); this.label5.TabIndex = 6; this.label5.Text = "Çarpımları : "; // // label6 // this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.label6.Location = new System.Drawing.Point(28, 306); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(70, 13); this.label6.TabIndex = 7; this.label6.Text = "Bölümleri : "; // // label7 // this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); this.label7.ForeColor = System.Drawing.Color.DarkRed; this.label7.Location = new System.Drawing.Point(26, 189); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(86, 25); this.label7.TabIndex = 8; this.label7.Text = "İşlemler"; // // linkLabel1 // this.linkLabel1.AutoSize = true; this.linkLabel1.Location = new System.Drawing.Point(77, 339); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.linkLabel1.Size = new System.Drawing.Size(124, 13); this.linkLabel1.TabIndex = 9; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "http://www.alikeskin.org"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // // label8 // this.label8.AutoSize = true; this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.25F); this.label8.Location = new System.Drawing.Point(98, 228); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(0, 13); this.label8.TabIndex = 10; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(98, 255); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(0, 13); this.label9.TabIndex = 11; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(98, 281); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(0, 13); this.label10.TabIndex = 12; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(98, 306); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(0, 13); this.label11.TabIndex = 13; // // button1 // this.button1.Location = new System.Drawing.Point(29, 94); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(235, 30); this.button1.TabIndex = 14; this.button1.Text = "Hesapla (Enter)"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // label12 // this.label12.AutoSize = true; this.label12.ForeColor = System.Drawing.SystemColors.MenuHighlight; this.label12.Location = new System.Drawing.Point(42, 9); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(222, 13); this.label12.TabIndex = 15; this.label12.Text = "Basit Hesap Makinası Programına Hoşgeldiniz"; // // button2 // this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.button2.Location = new System.Drawing.Point(29, 143); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(235, 28); this.button2.TabIndex = 16; this.button2.Text = "Temizle (Esc)"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // Form1 // this.AcceptButton = this.button1; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.button2; this.ClientSize = new System.Drawing.Size(300, 361); this.Controls.Add(this.button2); this.Controls.Add(this.label12); this.Controls.Add(this.button1); this.Controls.Add(this.label11); this.Controls.Add(this.label10); this.Controls.Add(this.label9); this.Controls.Add(this.label8); this.Controls.Add(this.linkLabel1); this.Controls.Add(this.label7); this.Controls.Add(this.label6); this.Controls.Add(this.label5); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox1); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "Form1"; this.Text = "Basit Hesap Makinası (C#)"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label7; private System.Windows.Forms.LinkLabel linkLabel1; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label11; private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label12; private System.Windows.Forms.Button button2; } } |
Form1.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
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 WindowsFormsApplication6 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { double sayi1, sayi2, toplam, fark, carp, bol; foreach (Control c in this.Controls) { if (c is TextBox2) { if ((c as TextBox).Text == "" || (c as TextBox).Text == "0") { MessageBox.Show("Hata1 : Sayı Alanını Boş Bıraktınız Veya Sıfır Değerini Girdiniz. Lütfen Sayı Girerek Tekrar Deneyiniz."); break; } sayi1 = Convert.ToDouble(textBox1.Text); sayi2 = Convert.ToDouble(textBox2.Text); toplam = sayi1 + sayi2; fark = sayi1 - sayi2; carp = sayi1 * sayi2; bol = sayi1 / sayi2; label8.Text = toplam.ToString(); label9.Text = fark.ToString(); label10.Text = carp.ToString(); label11.Text = bol.ToString(); } } } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://www.alikeskin.org"); } private void button2_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; label11.Text = ""; } } } |
Program.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace WindowsFormsApplication6 { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } } |
Programın .exe Halini İndirmek İçin Tıklayınız .
ALİ KESKİN Mustafa Kemal University Computer Engineering Iskenderun