Sunteți pe pagina 1din 8

03/06/2013

how to program a windows standard calculator - CodeProject


9,905,231 members (34,728 online) Sign in

home

articles

quick answers

discussions

features

community

help

Search for articles, questions, tips

Articles Languages C# Beginners

Article Browse Code Stats Revisions Alternatives Comments & Discussions (17)

how to program a windows standard calculator


By vivounicorn, 25 Aug 2008
1.60 (11 votes)

About Article
This article is help beginners to program a windows standard calculator Type Licence First Posted Views Downloads Bookmarked Article CPOL 25 Aug 2008 33,219 881 25 times

Download Calculator - 198.78 KB

.NET2.0 C# .NET Beginner Intermediate

Introduction
C# is an interesting language,in my opinion,beginners always need some samples for learning,I hope my article can help them.As your know,the function of windows calculator is so strong even standard version,it can process expression like this:"2+==*.3-4+5===" or "2.5*3-.6+4.4=+==-=" and so on,I think make a calculator without any bug is hard,so a good design can help you to decrease your bug,so I will try to do this.

Using the code


C a l c u l a t o r O p e r a t i o n - a class to provide basic function of calculator
.
u s i n gS y s t e m ; u s i n gS y s t e m . C o l l e c t i o n s . G e n e r i c ; u s i n gS y s t e m . T e x t ; u s i n gS y s t e m . C o l l e c t i o n s ; n a m e s p a c eN e w C a l c u l a t o r { p u b l i ce n u mO p e r a t o r{N O _ O P ,A D D ,S U B ,M U L ,D I V ,E Q U A L ,S Q R T ,B A C K W A R D S , P E R C E N T} i n t e r n a lc l a s sC a l c u l a t o r O p e r a t i o n { p u b l i cd e l e g a t ed e c i m a lM a t h e m a t i c O p e r a t i n g ( d e c i m a lo p t 1 ,d e c i m a lo p t 2 ) ; p u b l i cd e l e g a t ed e c i m a lO t h e r O p e r a t i n g ( d e c i m a lo p t 1 ) ; p u b l i cs t a t i cH a s h t a b l eh a s h T a b l e ; s t a t i cC a l c u l a t o r O p e r a t i o n ( ) { h a s h T a b l e=n e wH a s h t a b l e ( ) ; h a s h T a b l e . A d d ( " + " ,O p e r a t o r . A D D ) ; h a s h T a b l e . A d d ( " " ,O p e r a t o r . S U B ) ; h a s h T a b l e . A d d ( " * " ,O p e r a t o r . M U L ) ; h a s h T a b l e . A d d ( " / " ,O p e r a t o r . D I V ) ; h a s h T a b l e . A d d ( " = " ,O p e r a t o r . E Q U A L ) ; } p r i v a t es t a t i cd e c i m a lA d d ( d e c i m a lo p 1 ,d e c i m a lo p 2 ) { r e t u r nd e c i m a l . A d d ( o p 1 ,o p 2 ) ; } p r i v a t es t a t i cd e c i m a lS u b ( d e c i m a lo p 1 ,d e c i m a lo p 2 )
Collapse | Copy Code

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

1/8

03/06/2013

p r i v a t es t a t i cd e c i m a lS u b ( d e c i m a lo p 1 ,d e c i m a lo p 2 ) { r e t u r nd e c i m a l . S u b t r a c t ( o p 1 ,o p 2 ) ; } p r i v a t es t a t i cd e c i m a lM u l ( d e c i m a lo p 1 ,d e c i m a lo p 2 ) { r e t u r nd e c i m a l . M u l t i p l y ( o p 1 ,o p 2 ) ; } p r i v a t es t a t i cd e c i m a lD i v ( d e c i m a lo p 1 ,d e c i m a lo p 2 ) { / /i f( o p 2! =0 ) r e t u r nd e c i m a l . D i v i d e ( o p 1 ,o p 2 ) ; / / e l s e / / r e t u r nd e c i m a l . M i n V a l u e ; } p r i v a t es t a t i cd e c i m a lS q r t ( d e c i m a lo p 1 ) { r e t u r n( d e c i m a l ) M a t h . S q r t ( ( d o u b l e ) o p 1 ) ; } p r i v a t es t a t i cd e c i m a lB a c k w o r d s ( d e c i m a lo p 1 ) { r e t u r n1/o p 1 ; } p r i v a t es t a t i cd e c i m a lP e r c e n t ( d e c i m a lo p 1 ) { r e t u r no p 1/1 0 0 ; }

how to program a windows standard calculator - CodeProject

Top News
Old Japanese Man Creates Amazing Art Using Excel (Wait, Excel?)
Get the Insider News free each morning.

Related Videos

p u b l i cs t a t i cM a t h e m a t i c O p e r a t i n gM a t h e m a t i c ( O p e r a t o ro p t ) { M a t h e m a t i c O p e r a t i n gM O=n u l l ; i f( o p t= =O p e r a t o r . A D D ) { M O=n e wM a t h e m a t i c O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . A d d ) ; r e t u r nM O ; } i f( o p t= =O p e r a t o r . S U B ) { M O=n e wM a t h e m a t i c O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . S u b ) ; r e t u r nM O ; } i f( o p t= =O p e r a t o r . M U L ) { M O=n e wM a t h e m a t i c O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . M u l ) ; r e t u r nM O ; } i f( o p t= =O p e r a t o r . D I V ) { M O=n e wM a t h e m a t i c O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . D i v ) ; r e t u r nM O ; } r e t u r nn u l l ;

C++ Programming - 0709 Simple Calculator

Beginners Java Programming - 0808 Exercise 2 - A Calculator Program

Related Articles
Use Windows Crypto API to calculate a MD5 string. Windows Message Handling Part 1 Automate your UI using Microsoft Automation Framework Calculate pi to one million decimal places Windows Message Handling Part 3 A Calculator Control Box Business Dates Calculation A User-Friendly C# Descriptive Statistic Class Verhoeff Check Digit in C# Calculator - A desktop utility Floating Point in .NET part 1: Concepts and Formats Assembly.LoadFile versus Assembly.LoadFrom - .NET obscurity at its finest Engineering Calculator VOLTA2013 Avoiding Overflow, Underflow, and Loss of Precision Text-To-Speech An MFC Calculator Custom Control with No Resource File Dependencies Drop-Down Calculator
Collapse | Copy Code

p u b l i cs t a t i cO t h e r O p e r a t i n gO t h e r M a t h e m a t i c ( O p e r a t o ro p t ) { O t h e r O p e r a t i n gM O ; i f( o p t= =O p e r a t o r . S Q R T ) { M O=n e wO t h e r O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . S q r t ) ; r e t u r nM O ; } i f( o p t= =O p e r a t o r . B A C K W A R D S ) { M O=n e wO t h e r O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . B a c k w o r d s ) ; r e t u r nM O ; } i f( o p t= =O p e r a t o r . P E R C E N T ) { M O=n e wO t h e r O p e r a t i n g ( C a l c u l a t o r O p e r a t i o n . P e r c e n t ) ; r e t u r nM O ; } r e t u r nn u l l ;

C a l c u l a t o r C o n t r o l l e r - a class to simulate a calculator


. Blocks of code should be set as style "Formatted" like this:

Complex Calculator

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

2/8

03/06/2013

how to program a windows standard calculator - CodeProject


/ / / /A n ys o u r c ec o d eb l o c k sl o o kl i k et h i s / /

Collapse | Copy Code

CKRFloat - Arbitrary Precision Calculations Option Pricing using the Binomial Tree Model in C# Perfect Semi-transparent & Shaped Dialogs with Standard, ActiveX, and Translucent Controls for Windows 2000+

u s i n gS y s t e m ; u s i n gS y s t e m . C o l l e c t i o n s . G e n e r i c ; u s i n gS y s t e m . T e x t ;

n a m e s p a c eN e w C a l c u l a t o r { p u b l i cd e l e g a t ev o i dC h a n g e ( s t r i n gs t r ) ; p u b l i cc l a s sC a l c u l a t o r C o n t r o l l e r : I C o n t r o l l e r { # r e g i o np r i v a t ef i e l d p r i v a t ed e c i m a lm S t o r e=0 ; p r i v a t ed e c i m a lm R e s u l t=0 ; p r i v a t es t r i n gm D i s p l a y=s t r i n g . E m p t y ; / / /< s u m m a r y > / / /t h ef i r s to p e r a t o r / / /< / s u m m a r y > p r i v a t ed e c i m a lo p t 1=0 ; / / /< s u m m a r y > / / /t h es e c o n do p e r a t o r / / /< / s u m m a r y > p r i v a t ed e c i m a lo p t 2=0 ; / / /< s u m m a r y > / / /w h e t h e rt h ef i r s to p e r a t o ri sr e a d y / / /< / s u m m a r y > p r i v a t eb o o lo p t 1 I s R e a d y=f a l s e ; / / /< s u m m a r y > / / /w h e t h e rt h es e c o n do p e r a t o ri sr e a d y / / /< / s u m m a r y > p r i v a t eb o o lo p t 2 I s R e a d y=f a l s e ; / / /< s u m m a r y > / / /t os t o r ec u r r e n to p e r a r t o r / / /< / s u m m a r y > p r i v a t eO p e r a t o rc u r r e n t O p e r a t o r=O p e r a t o r . N O _ O P ; / / /< s u m m a r y > / / /w h e t h e rc l i c ko p e r a t o rb u t t o n s / / /< / s u m m a r y > p r i v a t eb o o li s C l i c k O p e r a t i n g B u t t o n=f a l s e ; / / /< s u m m a r y > / / /w h e t h e rc l i c kd i g i t a ln u m b e r / / /< / s u m m a r y > p r i v a t eb o o li s C l i c k D i g i t a l B u t t o n=f a l s e ; p r i v a t eb o o li s C a l c u l a t i n g=f a l s e ; p r i v a t eC h a n g eo n C h a n g e=n u l l ; # e n d r e g i o n # r e g i o np u b l i ca t t r i b u t e / / /< s u m m a r y > / / /g e to rs e t m D i s p l a y / / /< / s u m m a r y > p u b l i cs t r i n gD i s p l a y { g e t { } s e t { }

r e t u r nt h i s . m D i s p l a y ;

t h i s . m D i s p l a y=v a l u e ;

} / / /< s u m m a r y > / / /g e to rs e t o n C h a n g e / / /< / s u m m a r y > p u b l i cC h a n g eO n C h a n g e { g e t { r e t u r nt h i s . o n C h a n g e ; } s e t { o n C h a n g e=v a l u e ; } } # e n d r e g i o n # r e g i o np r i v a t em e t h o d / / /< s u m m a r y > / / /t od om a t h e m a t i ce x p r e s s i o n / / /< / s u m m a r y > / / /< p a r a mn a m e = " c u r O p t " > o p e r a t o r < / p a r a m > / / /< r e t u r n s > w h e t h e rs u c c e s s < / r e t u r n s > p r i v a t eb o o lM a t h e m a t i c P r o c e s s ( O p e r a t o rc u r O p t ) { i f( c u r r e n t O p e r a t o r= =O p e r a t o r . N O _ O P ) { i f( c u r O p t! =O p e r a t o r . E Q U A L )

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

3/8

03/06/2013

how to program a windows standard calculator - CodeProject


i f( c u r O p t! =O p e r a t o r . E Q U A L ) t h i s . c u r r e n t O p e r a t o r=c u r O p t ; t h i s . o p t 1 I s R e a d y=t r u e ; t h i s . o p t 2 I s R e a d y=f a l s e ; t h i s . i s C a l c u l a t i n g=f a l s e ; r e t u r nf a l s e ;

t h i s . o p t 2 ) ;

} e l s e { i f( O p e r a t o r . E Q U A L! =c u r O p t ) { i f( t h i s . o p t 1 I s R e a d y& &t h i s . o p t 2 I s R e a d y& &! t h i s . i s C a l c u l a t i n g ) { t h i s . m R e s u l t=C a l c u l a t o r O p e r a t i o n . M a t h e m a t i c ( t h i s . c u r r e n t O p e r a t o r ) ( t h i s . o p t 1 , t h i s . m D i s p l a y=t h i s . m R e s u l t . T o S t r i n g ( ) ; o p t 1=t h i s . m R e s u l t ; t h i s . o p t 1 I s R e a d y=t r u e ; t h i s . o p t 2 I s R e a d y=f a l s e ; t h i s . i s C a l c u l a t i n g=f a l s e ;

} i f( c u r O p t! =t h i s . c u r r e n t O p e r a t o r ) { t h i s . c u r r e n t O p e r a t o r=c u r O p t ; } { t h i s . o p t 1=d e c i m a l . P a r s e ( t h i s . m D i s p l a y . T o S t r i n g ( ) ) ; t h i s . o p t 2 I s R e a d y=f a l s e ; } } { i f( O p e r a t o r . E Q U A L= =c u r O p t ) i f( t h i s . o p t 1 I s R e a d y& &t h i s . o p t 2 I s R e a d y ) { t h i s . m R e s u l t=C a l c u l a t o r O p e r a t i o n . M a t h e m a t i c ( t h i s . c u r r e n t O p e r a t o r ) ( t h i s . o p t 1 , o p t 1=t h i s . m R e s u l t ; t h i s . m D i s p l a y=t h i s . m R e s u l t . T o S t r i n g ( ) ; t h i s . o p t 1 I s R e a d y=t r u e ; t h i s . o p t 2 I s R e a d y=t r u e ; t h i s . i s C a l c u l a t i n g=f a l s e ;

t h i s . o p t 2 ) ;

} i f( t h i s . o p t 1 I s R e a d y& &! t h i s . o p t 2 I s R e a d y ) { / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / t h i s . m R e s u l t=d e c i m a l . P a r s e ( t h i s . m D i s p l a y . T o S t r i n g ( ) ) ; t h i s . m R e s u l t=C a l c u l a t o r O p e r a t i o n . M a t h e m a t i c ( t h i s . c u r r e n t O p e r a t o r ) ( t h i s . m R e s u l t ,t h i s . o p t 1 ) ; t h i s . m D i s p l a y=t h i s . m R e s u l t . T o S t r i n g ( ) ; t h i s . o p t 1 I s R e a d y=t r u e ; t h i s . o p t 2 I s R e a d y=f a l s e ; } t h i s . i s C a l c u l a t i n g=t r u e ; } r e t u r nt r u e ;

# e n d r e g i o n # r e g i o np u b l i cm e t h o d / / /< s u m m a r y > / / /d e a lw i t h" C "b u t t o n / / /< / s u m m a r y > p u b l i cv o i dI n i t i a l i z e C a l c u l a t o r C o n t r o l l e r ( ) { t h i s . m D i s p l a y=s t r i n g . E m p t y ; t h i s . m R e s u l t=0 ; t h i s . o p t 1=0 ; t h i s . o p t 2=0 ; t h i s . o p t 1 I s R e a d y=f a l s e ; t h i s . o p t 2 I s R e a d y=f a l s e ; c u r r e n t O p e r a t o r=O p e r a t o r . N O _ O P ; i s C l i c k O p e r a t i n g B u t t o n=t r u e ; i s C a l c u l a t i n g=f a l s e ; } / / /< s u m m a r y > / / /d e a lw i t h" M C " " M R " " M S " " M + " / / /< / s u m m a r y > / / /< p a r a mn a m e = " s S u b " > c u r r e n tf u n c t i o n < / p a r a m > p u b l i cv o i dF u n c t i o n B u t t o n C l i c k ( s t r i n gs S u b ) { i f( " M C "= =s S u b . T r i m ( ) . T o U p p e r ( ) ) { t h i s . m S t o r e=0 ; i f( O n C h a n g e! =n u l l ) O n C h a n g e ( " " ) ; r e t u r n ; } i f( " M R "= =s S u b . T r i m ( ) . T o U p p e r ( ) ) { / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / t h i s . i s C a l c u l a t i n g=f a l s e ;

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

4/8

03/06/2013

how to program a windows standard calculator - CodeProject


t h i s . m D i s p l a y=t h i s . m S t o r e . T o S t r i n g ( ) ; r e t u r n ; } i f( " M S "= =s S u b . T r i m ( ) . T o U p p e r ( ) ) { t h i s . m S t o r e=d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ; i f( O n C h a n g e! =n u l l ) O n C h a n g e ( " M " ) ; r e t u r n ;

} i f( " M + "= =s S u b . T r i m ( ) . T o U p p e r ( ) ) { t h i s . m S t o r e+ =d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ; i f( O n C h a n g e! =n u l l ) O n C h a n g e ( " M " ) ; } r e t u r n ;

/ / /< s u m m a r y > / / /d e a lw i t h" b a c k s p a c e " / / /< / s u m m a r y > p u b l i cv o i dB a c k s p a c e C l i c k ( ) { i f( ! t h i s . i s C a l c u l a t i n g ) { i f( t h i s . m D i s p l a y . L e n g t h>1 ) { t h i s . m D i s p l a y=t h i s . m D i s p l a y . S u b s t r i n g ( 0 ,t h i s . m D i s p l a y . L e n g t h-1 ) ; } e l s e { t h i s . m D i s p l a y=" 0 " ; } } } / / /< s u m m a r y > / / /d e a lw i t hn u m b e rb u t t o n s / / /< / s u m m a r y > / / /< p a r a mn a m e = " s S u b " > c u r r e n tn u m b e r < / p a r a m > p u b l i cb o o lD i g i t a l B u t t o n C l i c k ( s t r i n gs S u b ) { t r y { i s C l i c k D i g i t a l B u t t o n=t r u e ; i f( " + / "! =s S u b . T r i m ( )& &! ( s S u b . E q u a l s ( " 0 " )& &s S u b . E q u a l s ( t h i s . m D i s p l a y . T r i m ( ) ) ) ) { i f( ! s S u b . E q u a l s ( " 0 " )& &t h i s . m D i s p l a y . E q u a l s ( " 0 " )& &! s S u b . E q u a l s ( " . " ) ) { t h i s . m D i s p l a y=s S u b ; r e t u r nt r u e ; } i f( s S u b . E q u a l s ( " . " ) ) { i f( t h i s . m D i s p l a y . I n d e x O f ( " . " )> =0 { i f( t h i s . i s C a l c u l a t i n g ) { t h i s . m D i s p l a y=" 0 " ; i s C l i c k O p e r a t i n g B u t t o n=f a l s e ; r e t u r nt r u e ; } r e t u r nf a l s e ; } i f( t h i s . i s C l i c k O p e r a t i n g B u t t o n ) { i f( t h i s . m D i s p l a y . E q u a l s ( " 0 " )| |t h i s . m D i s p l a y . E q u a l s ( " " ) ) { t h i s . m D i s p l a y=" 0 " ; i s C l i c k O p e r a t i n g B u t t o n=f a l s e ; r e t u r nt r u e ; } }

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

} e l s e i f( " + / "= =s S u b . T r i m ( ) ) { d e c i m a lt m p=0 . 0 m-d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ; i f( t m p= =0 ) { i f( t h i s . m D i s p l a y . I n d e x O f ( ' ' )> =0 )

i f( ! t h i s . i s C l i c k O p e r a t i n g B u t t o n ) { t h i s . m D i s p l a y+ =s S u b ; } e l s e { i s C l i c k O p e r a t i n g B u t t o n=f a l s e ; t h i s . m D i s p l a y=s S u b ; }

5/8

03/06/2013

how to program a windows standard calculator - CodeProject


i f( t h i s . m D i s p l a y . I n d e x O f ( ' ' )> =0 ) t h i s . m D i s p l a y=t h i s . m D i s p l a y . S u b s t r i n g ( 1 ,t h i s . m D i s p l a y . L e n g t h 1 ) ; e l s e t h i s . m D i s p l a y=" "+t m p . T o S t r i n g ( ) ;

} c a t c h { r e t u r nf a l s e ; }

} r e t u r nt r u e ;

} e l s e t h i s . m D i s p l a y=t m p . T o S t r i n g ( ) ;

/ / /< s u m m a r y > / / /d e a lw i t ho p e r a t o r / / /< / s u m m a r y > / / /< p a r a mn a m e = " s S u b " > c u r r e n to p e r a t o r < / p a r a m > p u b l i cb o o lO p e r a t i n g B u t t o n C l i c k ( s t r i n gs S u b ) { t r y { i f( ! t h i s . o p t 1 I s R e a d y ) { t h i s . o p t 1=d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ; t h i s . o p t 1 I s R e a d y=t r u e ;

} e l s e i f( i s C l i c k D i g i t a l B u t t o n& &! t h i s . o p t 2 I s R e a d y ) { t h i s . o p t 2 I s R e a d y=t r u e ; t h i s . o p t 2=d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ; } i s C l i c k O p e r a t i n g B u t t o n=t r u e ; i s C l i c k D i g i t a l B u t t o n=f a l s e ; M a t h e m a t i c P r o c e s s ( ( O p e r a t o r ) C a l c u l a t o r O p e r a t i o n . h a s h T a b l e [ s S u b ] ) ; r e t u r nt r u e ; } c a t c h { r e t u r nf a l s e ; }

/ / /< s u m m a r y > / / /t oc a l c u l a t ee x p r e s s i o n / / /< / s u m m a r y > / / /< p a r a mn a m e = " e x p r e s s i o n " > e x p r e s s i o n < / p a r a m > / / /< p a r a mn a m e = " c h a n g e " > r e s u l t < / p a r a m > / / /< r e t u r n s > w h e t h e rs u c c e s s < / r e t u r n s > p u b l i cb o o lE x e c u t e E x p r e s s i o n ( s t r i n ge x p r e s s i o n ,C h a n g ec h a n g e ) { b o o lf l a g=t r u e ; f o r e a c h( c h a rc hi ne x p r e s s i o n ) { i f( c h> =' 0 '& &c h< =' 9 '| |' . '= =c h ) { f l a g=t h i s . D i g i t a l B u t t o n C l i c k ( c h . T o S t r i n g ( ) ) ; c h a n g e ( t h i s . m D i s p l a y ) ; c o n t i n u e ; } i f( ' + '= =c h| |' '= =c h| |' * '= =c h| |' / '= =c h| |' = '= =c h ) { f l a g=t h i s . O p e r a t i n g B u t t o n C l i c k ( c h . T o S t r i n g ( ) ) ; c h a n g e ( t h i s . m D i s p l a y ) ; c o n t i n u e ; }

} }

r e t u r nf l a g ;

/ / /< s u m m a r y > / / /o t h e ro p e r a t o r / / /< / s u m m a r y > / / /< p a r a mn a m e = " o p t " > o p e r a t o r < / p a r a m > / / /< r e t u r n s > r e s u l t < / r e t u r n s > p u b l i cd e c i m a lO t h e r C a l c u l a t i o n g ( s t r i n go p t ) { i f( " s q r t "= =o p t . T o L o w e r ( ) ) { t h i s . i s C l i c k O p e r a t i n g B u t t o n=t r u e ; r e t u r nC a l c u l a t o r O p e r a t i o n . O t h e r M a t h e m a t i c ( O p e r a t o r . S Q R T ) ( d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ) ; } i f( " 1 / x "= =o p t . T o L o w e r ( ) ) { t h i s . i s C l i c k O p e r a t i n g B u t t o n=t r u e ; r e t u r nC a l c u l a t o r O p e r a t i o n . O t h e r M a t h e m a t i c ( O p e r a t o r . B A C K W A R D S ) ( d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ) ; } i f( " % "= =o p t . T o L o w e r ( ) ) { t h i s . i s C l i c k O p e r a t i n g B u t t o n=t r u e ;

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

6/8

03/06/2013

how to program a windows standard calculator - CodeProject


t h i s . i s C l i c k O p e r a t i n g B u t t o n=t r u e ; r e t u r nC a l c u l a t o r O p e r a t i o n . O t h e r M a t h e m a t i c ( O p e r a t o r . P E R C E N T ) ( d e c i m a l . P a r s e ( t h i s . m D i s p l a y ) ) ; } r e t u r n0 . 0 m ; } # e n d r e g i o n } }

History
08.01.2008 - Initial release

License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

vivounicorn
Software Developer acca China I love to communicate with eachother.

Article Top

Like

Tweet

Sign Up to vote Poor

Excellent

Vote

Comments and Discussions


Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'. You must Sign In to use this message board. Search this forum Profile popups Spacing Relaxed Noise Very High Layout Normal Per page 10 Go Update

First Prev Next

Thanks Why not put the delegates in the Dictionary? m_CE_Click problem Re: m_CE_Click problem Can you add...

Member 4507223 PIEBALDconsult edwardxu888 edwardxu888 Ethnica

13 Sep '12 - 16:06 16 Nov '09 - 5:16 3 Sep '09 - 12:01 3 Sep '09 - 12:10 5 Jan '09 - 20:20

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

7/8

03/06/2013
Not Like Standard Calculator

how to program a windows standard calculator - CodeProject


Arman Z. Sahakyan vivounicorn Abhishek sur pwasser Abhishek sur Refresh Bug Answer Joke Rant Admin
Article Copyright 2008 by vivounicorn Everything else Copyright CodeProject, 1999-2013 Terms of Use

27 Aug '08 - 3:02 27 Aug '08 - 4:04 26 Aug '08 - 11:08 26 Aug '08 - 17:41 26 Aug '08 - 22:29 1 2 Next

Re: Not Like Standard Calculator not coded properly.. Re: not coded properly.. Re: not coded properly..
Last Visit: 31 Dec '99 - 18:00 General News Last Update: 2 Jun '13 - 15:39 Suggestion Question

Permalink | Advertise | Privacy | Mobile Web02 | 2.6.130531.1 | Last Updated 25 Aug 2008

Layout: fixed | fluid

www.codeproject.com/Articles/28833/how-to-program-a-windows-standard-calculator

8/8

S-ar putea să vă placă și