Demo - Calculator - By Hand!


Diễn đàn chia sẻ kiến thức, kinh nghiệm về IT và cuộc sống!
 
Trang ChínhGalleryTìm kiếmLatest imagesĐăng kýĐăng Nhập
Top posters
Sakura (1124)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
hotboy (705)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
Già Làng (373)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
con_ca_nho90 (289)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
that_true (154)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
theanhkkt (143)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
phamay (137)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
lovelonelyman (134)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
o0ovioletstaro0o (128)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
stevenhung (122)
Demo - Calculator - By Hand! Vote_lcapDemo - Calculator - By Hand! Voting_barDemo - Calculator - By Hand! Vote_rcap 
Âm - Dương lịch
Clock
Logo
11TH02 Pro!
Liên kết
Tin tức 60s
Tin công nghệ
Thời sự 24h
Game Moblie

Share
 

 Demo - Calculator - By Hand!

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down 
Tác giảThông điệp
GGGG

Demo - Calculator - By Hand! Stars16


Nam Pisces

Số bài viết : 11
Điểm : 14
Được cảm ơn : 0
Ngày sinh : 15/03/1989
Tham gia ngày : 16/10/2010
Tuổi : 35
Đến từ : AL

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime24/10/2010, 10:20

Đây là bài mình làm bằng code 100%!
Còn nhiều lỗi, nhưng làm biếng Fix quá! Chủ yếu là biết cách Coding bằng tay thôi!
Link Demo: [You must be registered and logged in to see this link.]
P/S: Đã giảm xuống .NET 3.5 cho họ hàng XP, Ai có nhu cầu muốn xem cách làm thì comment he!
Về Đầu Trang Go down
Già Làng

Demo - Calculator - By Hand! Stars14
Già Làng

Thú CƯng : Demo - Calculator - By Hand! I-hate-Cats-icon
Nam Libra

Số bài viết : 373
Điểm : 2200708
Được cảm ơn : 53
Ngày sinh : 20/10/1987
Tham gia ngày : 16/03/2010
Tuổi : 36
Đến từ : Bình Dương
Ngề nghiệp : Sinh Viên
Chăm ngôn : Cơm Cha - Áo Mẹ!

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime24/10/2010, 16:33

ToYeuCau đã viết:
Đây là bài mình làm bằng code 100%!
Còn nhiều lỗi, nhưng làm biếng Fix quá! Chủ yếu là biết cách Coding bằng tay thôi!
Link Demo: [You must be registered and logged in to see this link.]
P/S: Đã giảm xuống .NET 3.5 cho họ hàng XP, Ai có nhu cầu muốn xem cách làm thì comment he!
mai mốt đưa code lên luôn đi huynh!!! Rồi kèm theo link dowload nữa cho tròn bộ. CÒn đậy là demo của tui đây, kekekke!!!

[You must be registered and logged in to see this image.]

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Calculator
{
    public class Program:Form
    {
        private TextBox t1;
        private Label lb;
        private Button b;
        private Button b1;
        private Button b2;
        private Button b3;
        private Button b4;
        private Button b5;
        private Button b6;
        private Button b7;
        private Button b8;
        private Button b9;
        private Button b10;
        private Button Add;
        private Button Sub;
        private Button Mul;
        private Button Div;
        private Button cham;
        private Button ca;
        private Button soam;
        private Button bp;
        private Button gt;
        private bool kiemtra;
        private string oper, sonho;
        private Double n;
        private Double s;
        private Double i;
        MainMenu mMenu;
        MenuItem mFile;
        MenuItem mExit;
        MenuItem mAbout;

        public static void Main(string[] args)
        {
           
            Application.Run(new Program());
                     
           
        }
        public Program()
        {   
            //Design
     
         
            mMenu = new MainMenu();           
            mFile=new MenuItem();
            mFile.Text="File"; 
            mExit = new MenuItem();
            mAbout = new MenuItem();
            mAbout.Text = "About";
            mAbout.Click += new EventHandler(mAbout_Click);
            mExit.Text = "Exit";
            mExit = new MenuItem("Exit", new EventHandler(mExit_Click),  Shortcut.CtrlE );
            mExit.Click+=new EventHandler(mExit_Click);
            mFile.MenuItems.Add(mExit);
            mMenu.MenuItems.Add(mFile);
            mFile.MenuItems.Add(mAbout);
            this.Menu = mMenu;                   
            this.Name = "Program";
            this.Text = "Tính";
            this.Size = new Size(165,280);
            this.Load += new EventHandler(Program_Load);
            this.FormBorderStyle = FormBorderStyle.Fixed3D;           
            this.MaximizeBox = false;
            this.lb = new Label();
            this.b = new Button();
            this.b1 = new Button();
            this.b2 = new Button();
            this.b3 = new Button();
            this.b4 = new Button();
            this.b5 = new Button();
            this.b6 = new Button();
            this.b7 = new Button();
            this.b8 = new Button();
            this.b9 = new Button();
            this.b10 = new Button();
            this.Add = new Button();
            this.Sub = new Button();
            this.Mul = new Button();
            this.Div = new Button();
            this.cham = new Button();
            this.ca = new Button();
            this.soam = new Button();
            this.bp = new Button();
            this.gt = new Button();
            this.t1 = new TextBox();
            lb.Text = "Tam Calculator@";
            b.Text = "=";
            b10.Text = "0";
            b1.Text = "1";
            b2.Text = "2";
            b3.Text = "3";
            b4.Text = "4";
            b5.Text = "5";
            b6.Text = "6";
            b7.Text = "7";
            b8.Text = "8";
            b9.Text = "9";
            cham.Text = ".";
            Add.Text = "+";
            Sub.Text = "-";
            Mul.Text = "x";
            Div.Text = "/";
            ca.Text = "CA";
            soam.Text = "M-";
            bp.Text = "x^2";
            gt.Text = "!";     
            lb.Location=new Point(30,50);
            b.Location = new Point(80, 200);
            b.Size = new Size(30, 25);
            b.Click += new EventHandler(b_Click);
            b10.Location = new Point(10,200);
            b10.Size = new Size(30, 25);
            b10.Click += new EventHandler(b10_Click);
            cham.Location = new Point(45, 200);
            cham.Size = new Size(30, 25);
            cham.Click += new EventHandler(cham_Click);
            Add.Location = new Point(115,200);
            Add.Size = new Size(30, 25);
            Add.Click += new EventHandler(Add_Click);
            b1.Location = new Point(10,170);
            b1.Click += new EventHandler(b1_Click);
            b1.Size = new Size(30, 25);
            b2.Location = new Point(45, 170);
            b2.Size = new Size(30, 25);
            b2.Click += new EventHandler(b2_Click);
            b3.Location = new Point(80, 170);
            b3.Size = new Size(30, 25);
            b3.Click += new EventHandler(b3_Click);
            Sub.Location = new Point(115, 170);
            Sub.Size = new Size(30, 25);
            Sub.Click += new EventHandler(Sub_Click);
            b4.Location = new Point(10, 140);
            b4.Size = new Size(30, 25);
            b4.Click += new EventHandler(b4_Click);
            b5.Location = new Point(45, 140);
            b5.Size = new Size(30, 25);
            b5.Click+=new EventHandler(b5_Click);
            b6.Location = new Point(80, 140);
            b6.Size = new Size(30, 25);
            b6.Click += new EventHandler(b6_Click);
            Mul.Location = new Point(115, 140);
            Mul.Size = new Size(30, 25);
            Mul.Click += new EventHandler(Mul_Click);
            b7.Location = new Point(10, 110);
            b7.Size = new Size(30, 25);
            b7.Click += new EventHandler(b7_Click);
            b8.Location = new Point(45, 110);
            b8.Size = new Size(30, 25);
            b8.Click += new EventHandler(b8_Click);
            b9.Location = new Point(80, 110);
            b9.Size = new Size(30, 25);
            b9.Click += new EventHandler(b9_Click);
            Div.Location = new Point(115, 110);
            Div.Size = new Size(30, 25);
            Div.Click += new EventHandler(Div_Click);
            ca.Location = new Point(115, 80);
            ca.Size = new Size(30, 25);
            ca.Click += new EventHandler(ca_Click);
            soam.Location = new Point(80,80);
            soam.Size = new Size(30, 25);
            soam.Click += new EventHandler(soam_Click);
            bp.Location = new Point(45,80);
            bp.Size = new Size(30, 25);
            bp.Click += new EventHandler(bp_Click);
            gt.Location = new Point(10,80);
            gt.Size = new Size(30,25);
            gt.Click += new EventHandler(gt_Click);
            t1.Location = new Point(10, 20);
            t1.Size = new Size(135,50);
            //Add len Form
            this.Controls.Add(lb);
            this.Controls.Add(t1);           
            this.Controls.Add(b);
            this.Controls.Add(b10);
            this.Controls.Add(b1);
            this.Controls.Add(b2);
            this.Controls.Add(b3);
            this.Controls.Add(b4);
            this.Controls.Add(b5);
            this.Controls.Add(b6);
            this.Controls.Add(b7);
            this.Controls.Add(b8);
            this.Controls.Add(b9);
            this.Controls.Add(Add);
            this.Controls.Add(Sub);
            this.Controls.Add(Mul);
            this.Controls.Add(Div);
            this.Controls.Add(cham);
            this.Controls.Add(ca);
            this.Controls.Add(soam);
            this.Controls.Add(bp);
            this.Controls.Add(gt);
            [You must be registered and logged in to see this link.]
        }

        void mAbout_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Phần mềm được phát triển bởi Programing Mai Thanh Tâm\nMọi chi tiết xin liên hệ:\n  - SĐT: 01688521617\n  - Mail: [You must be registered and logged in to see this link.]", "About", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
         
        }

        void gt_Click(object sender, EventArgs e)
        {
            this.sonho = this.t1.Text;
            this.kiemtra = true;
            this.oper = "!";
        }

        void bp_Click(object sender, EventArgs e)
        {
            this.sonho = this.t1.Text;           
            this.kiemtra = true;
            this.oper = "x^2";
        }

        void soam_Click(object sender, EventArgs e)
        {
            this.t1.Text = "-" + this.t1.Text;
        }

        void ca_Click(object sender, EventArgs e)
        {
            this.t1.Text = "0.";
            this.kiemtra = true;
        }

        void Program_Load(object sender, EventArgs e)
        {
            this.t1.Visible = true;
        }

        void Div_Click(object sender, EventArgs e)
        {
            this.sonho = this.t1.Text;
            this.kiemtra = true;
            this.oper = "/";
        }

        void Mul_Click(object sender, EventArgs e)
        {
            this.sonho = this.t1.Text;
            this.kiemtra = true;
            this.oper = "x";
        }

        void Sub_Click(object sender, EventArgs e)
        {
            this.sonho = this.t1.Text;
            this.kiemtra = true;
            this.oper = "-";
        }

        void Add_Click(object sender, EventArgs e)
        {
            this.sonho = this.t1.Text;
            this.kiemtra = true;
            this.oper = "+";
        }

        void cham_Click(object sender, EventArgs e)
        {
            if (this.t1.Text.Contains(".")) return;
            this.t1.Text = this.t1.Text + ".";
        }

        void b9_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b9.Text;
            this.kiemtra = false;
        }

        void b8_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b8.Text;
            this.kiemtra = false;
        }

        void b7_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b7.Text;
            this.kiemtra = false;
        }

        void b6_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b6.Text;
            this.kiemtra = false;
        }
        void b5_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b5.Text;
            this.kiemtra = false;
        }

        void b4_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b4.Text;
            this.kiemtra = false;
        }

        void b3_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b3.Text;
            this.kiemtra = false;
        }

        void b2_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b2.Text;
            this.kiemtra = false;
        }

        void b1_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b1.Text;
            this.kiemtra = false;
        }

        public void b10_Click(object sender, EventArgs e)
        {
            if (kiemtra) this.t1.Clear();
            this.t1.Text = this.t1.Text + this.b10.Text;
            this.kiemtra = false;
        }
        public void mExit_Click(Object sender, EventArgs ea)
        {
            Application.Exit();
        }
        public void miFileOpen_Click(Object sender, EventArgs ea)
        {
            MessageBox.Show("Menu Open Click");
        }
        public void b_Click(object sender, EventArgs e)
        {
         

       
            double b = Convert.ToDouble(this.t1.Text);
            double a = Convert.ToDouble(this.sonho);
            if (this.oper == "+")
            {
                this.t1.Text  = Convert.ToString(a + b);
            }
            if (this.oper == "-")
            {
                this.t1.Text = Convert.ToString(a - b);
            }
            if (this.oper == "x")
            {
                this.t1.Text = Convert.ToString(a * b);
            }
            if (this.oper == "/")
            {
                this.t1.Text = Convert.ToString(a / b);
            }
            if (this.oper == "x^2")
            {
                this.t1.Text = Convert.ToString(a * a);
            }
            if (this.oper == "!")
            {
                s = 1;
                n = a; ;
                for (i = 1; i < n; i++)
                {
                    s = s * i;
                }
                    this.t1.Text = Convert.ToString(s*i);
            }
            this.kiemtra = true ;
       
        }

       
    }
}


LinkDemo:[You must be registered and logged in to see this link.]

Mới coding trên 1 class, các bạn tham khảo và cho ý kiến.
=======Cặp nhật mới, có menu các bạn đóng góp!!=========


Được sửa bởi Già Làng ngày 25/10/2010, 00:48; sửa lần 6.
Về Đầu Trang Go down
https://itworld.forumvi.net
GGGG

Demo - Calculator - By Hand! Stars16


Nam Pisces

Số bài viết : 11
Điểm : 14
Được cảm ơn : 0
Ngày sinh : 15/03/1989
Tham gia ngày : 16/10/2010
Tuổi : 35
Đến từ : AL

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime24/10/2010, 18:21

Tự thấy mình thấp kém! Bái phục! Heheh!
Về Đầu Trang Go down
§amurai

Demo - Calculator - By Hand! Stars16
§amurai

Nam Aquarius

Số bài viết : 44
Điểm : 67
Được cảm ơn : 1
Ngày sinh : 02/02/1990
Tham gia ngày : 06/09/2010
Tuổi : 34
Đến từ : Truyện Tranh

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime24/10/2010, 20:01

Wow! hay thiệt đó nha! công nhận ý tưởng này hay lắm! Tui tham khảo mới được!hihi
Về Đầu Trang Go down
§amurai

Demo - Calculator - By Hand! Stars16
§amurai

Nam Aquarius

Số bài viết : 44
Điểm : 67
Được cảm ơn : 1
Ngày sinh : 02/02/1990
Tham gia ngày : 06/09/2010
Tuổi : 34
Đến từ : Truyện Tranh

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime25/10/2010, 21:22

Cho tui góp ý cái nha!
-- M- của Tâm bị sao ấy ấn bao nhiu thì nó hiện ra bấy nhiu à.
-- CA nữa, lúc đầu tui ấn số 2 chẳng hạn xong ấn CA và ấn tiếp * 2 thì nó lại bằng 4, Tâm cần sửa lại là khi ấn CA thì test = ""; là được rồi!
Về Đầu Trang Go down
gunmonter

Demo - Calculator - By Hand! Stars16
gunmonter

Thú CƯng : Demo - Calculator - By Hand! Dolphin-icon
Nam Capricorn

Số bài viết : 25
Điểm : 23
Được cảm ơn : 0
Ngày sinh : 01/01/1991
Tham gia ngày : 20/05/2010
Tuổi : 33
Đến từ : star
Ngề nghiệp : Student
Chăm ngôn : Humor

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime26/10/2010, 14:47

Mấy cái trên thì dễ Fix thôi!
M- thì nên đổi tên thành M +/- hay hơn :
this.t1.Text = (0 - Float.Parse(this.t.Text))ToString();
AC thì cho
sonho =0;
Về Đầu Trang Go down
phamay

Member Năng Động


Member Năng Động
phamay

Thú CƯng : Demo - Calculator - By Hand! Pig-icon
Nam Libra

Số bài viết : 137
Điểm : 222
Được cảm ơn : 5
Ngày sinh : 20/10/1990
Tham gia ngày : 21/03/2010
Tuổi : 33
Đến từ : Đăk Lăk
Ngề nghiệp : Sờ tu đen
Chăm ngôn : IT

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime26/10/2010, 17:34

Khá lắm Già làng!! Cố gắng phát huy nha...để fix lỗi nha..... Hihihi
Về Đầu Trang Go down
Già Làng

Demo - Calculator - By Hand! Stars14
Già Làng

Thú CƯng : Demo - Calculator - By Hand! I-hate-Cats-icon
Nam Libra

Số bài viết : 373
Điểm : 2200708
Được cảm ơn : 53
Ngày sinh : 20/10/1987
Tham gia ngày : 16/03/2010
Tuổi : 36
Đến từ : Bình Dương
Ngề nghiệp : Sinh Viên
Chăm ngôn : Cơm Cha - Áo Mẹ!

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime26/10/2010, 19:42

phamay đã viết:
Khá lắm Già làng!! Cố gắng phát huy nha...để fix lỗi nha..... Hihihi
Phải gọi là tham khảo, chứ sao gọi là Fix lỗi được. Đâu phải ai cũng viết được đâu? Kakak!
Về Đầu Trang Go down
https://itworld.forumvi.net
control_duty

Demo - Calculator - By Hand! Stars16


Nam Scorpio

Số bài viết : 16
Điểm : 20
Được cảm ơn : 0
Ngày sinh : 10/11/1988
Tham gia ngày : 21/09/2010
Tuổi : 35
Đến từ : hat

Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime26/10/2010, 19:51

Code của Già làng nhiều cái cao siêu lắm!
Nói là Tham khảo chứ cũng không hiểu được Razz
Về Đầu Trang Go down
Sponsored content




Demo - Calculator - By Hand! Empty
Bài gửiTiêu đề: Re: Demo - Calculator - By Hand!   Demo - Calculator - By Hand! I_icon_minitime

Về Đầu Trang Go down
 

Demo - Calculator - By Hand!

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang 
Trang 1 trong tổng số 1 trang

 Similar topics

-
» Video học C# [Demo chương trình Calculator với ngôn ngữ CSharp P1]
» Video học C# [Demo chương trình Calculator với ngôn ngữ CSharp P2]
» [Bài Tập C#] Demo Bài PHANSO trên C# với WPF
» Demo AWT của thầy Thành nè!
» Demo ProgressBar And Timer

Permissions in this forum:Bạn không có quyền trả lời bài viết
IT World! :: HỌC TẬP :: HỌC KỲ V :: Nhập môn .Net-