School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 353,888 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,174 people online right now.Registration is fast and FREE... Join Now!



basic calculator

52 Weeks of Code Challenge: WPF
Week #10 of the 52 Weeks of Code Challenge is WPF. If you're a .NET programmer, you should give it a shot. Click Here!

basic calculator implementing keyboard input Rate Topic: -----

#1 irishgirl  Icon User is offline

  • D.I.C Head
  • PipPip

Reputation: 1
  • View blog
  • Posts: 178
  • Joined: 22-August 08


Dream Kudos: 0

Post icon  Posted 18 September 2009 - 07:38 AM

I now have my basic calculator fully working. I would like to implement keyboard input for my buttons. What would the best way to do this? I've never done so before. Would I be better off/more efficient in using an event handler which handles when a key is pressed, or can I use mnemonics shortcuts in my methods? (that might be the same thing, not 100% sure!)
Was This Post Helpful? 0
  • +
  • -


#2 eclipsed4utoo  Icon User is online

  • Not Your Ordinary Programmer
  • Icon

Reputation: 313
  • View blog
  • Posts: 2,433
  • Joined: 21-March 08


Dream Kudos: 650

Expert In: .NET

Re: basic calculator

Posted 18 September 2009 - 07:42 AM

I would use the KeyPress event for the form to handle the keyboard input. To me, it's easier to limit the keypresses to only allow numbers.
Was This Post Helpful? 0
  • +
  • -

#3 c0dePoet  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 27-March 09


Dream Kudos: 0

Re: basic calculator

Posted 18 September 2009 - 07:47 AM

i would say an event handler for keypress would work fine

n/m i didn't notice eclipsed4utoo beat me to the punch ;)

This post has been edited by c0dePoet: 18 September 2009 - 07:48 AM

Was This Post Helpful? 0
  • +
  • -

#4 Theaegd  Icon User is offline

  • Hater & Lover
  • PipPipPipPip

Reputation: -118
  • View blog
  • Posts: 881
  • Joined: 15-August 09


Dream Kudos: 0

Re: basic calculator

Posted 18 September 2009 - 12:20 PM

yeah, and make sure you use plenty of ginger
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month