Hi Siimont, welcome on the daniweb site.
Have a look at this thread, in one of the posts it has a zip file with some code for a calculator. It is a simulation of a calculator I have at home.
It acts differently than the MS one but if you look at the code it must be somehow possible to convert this into the action an MS calculator does in case of a percentage calculation.
This is a piece of my code that handles the "function" buttons on my calculator, for further details look in the zip file, or ask a question.