Im new to programming and I dont know very much about but I'm making a calculator, and i want to use a textbox that only acepts numbers and decimals, and when the user paste text from the clipboard the textbox deletes any literal characters, like the MS calc.
Please take the time to explain each part so I can learn or write it and tell me what to search.
Thanks
EDIT: I'll make it more specific:
How can I make a numeric textbox in C#? I've used the masked textbox but it wont take decimals.
I've read things about overloading the OnKeyPress method so it will correct any wrong characters but I dont know to do it.
If you look closely, In Windows Calculator, the numbers are shown in a label not a textbox (It does not receive focus). The window receives keyboard events.
So look at KeyPressed and KeyDown events on the form.
Research the MaskedTextBox.
The question is a little broad to explain everything. Try to focus the question if you want specifics because you're asking for a lot of the community to "explain each part." If you ask a few specific questions (and exclude the "please the the time to explain..."), you'll get better responses.
Being a novice you might be better off investing in a good third party toolkit. Radcontrols from Telerik for instance has a numeric textbox that will accomplish what you are looking for.
The easiest way :)
on Keypress event on your textbox
i would probably use a regular expression to screen out non-numerics.
pseudo code: