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

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



Record Keystrokes in windows forms

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!

Record Keystrokes in windows forms Move a label with the arrow keys Rate Topic: -----

#1 orangeinternet  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 14-June 09


Dream Kudos: 0

Posted 14 June 2009 - 09:15 AM

How do you move a label using arrow keys?

Thanks in advance!
Was This Post Helpful? 0
  • +
  • -


#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • Icon

Reputation: 141
  • View blog
  • Posts: 1,931
  • Joined: 05-June 09


Dream Kudos: 150

Expert In: PHP, MySQL, HTML, CSS, C#

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:18 AM

Handle the KeyPress/KeyDown/KeyUp event(s) as required.
Was This Post Helpful? 0
  • +
  • -

#3 orangeinternet  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 14-June 09


Dream Kudos: 0

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:19 AM

Can you show me some Code, (im not that good at C#)
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • apt-get install DIC.bin
  • Icon

Reputation: 701
  • View blog
  • Posts: 16,787
  • Joined: 26-July 07


Dream Kudos: 12450

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:23 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#5 orangeinternet  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 14-June 09


Dream Kudos: 0

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:34 AM

I know your policy, i have researched it forever, and i was wondering if there was any simpler way (what i saw was very complicated)

Thanks
Was This Post Helpful? 0
  • +
  • -

#6 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • Icon

Reputation: 141
  • View blog
  • Posts: 1,931
  • Joined: 05-June 09


Dream Kudos: 150

Expert In: PHP, MySQL, HTML, CSS, C#

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:41 AM

Assigning event handlers is part of the C# language, it's fairly standard/basic stuff and any C# tutorial would teach you that :)
Was This Post Helpful? 0
  • +
  • -

#7 orangeinternet  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 14-June 09


Dream Kudos: 0

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:42 AM

None of the C# tutorials have even touched on it, what one are you thinking of?
Was This Post Helpful? 0
  • +
  • -

#8 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • Icon

Reputation: 141
  • View blog
  • Posts: 1,931
  • Joined: 05-June 09


Dream Kudos: 150

Expert In: PHP, MySQL, HTML, CSS, C#

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:51 AM

http://msdn.microsof...739(VS.71).aspx
http://www.softsteel...p/lesson16.html
http://www.csharp-st...s/Lesson14.aspx
http://www.switchont...event-accessors
http://www.devhood.c...tutorial_id=380
http://csharpcomputi...ls/Lesson15.htm
http://www.csharphel...archive253.html
http://www.geekpedia...-in-Csharp.html
http://www.switchont...-event-contents
Was This Post Helpful? 0
  • +
  • -

#9 danzar  Icon User is offline

  • D.I.C Head
  • Icon

Reputation: 2
  • View blog
  • Posts: 77
  • Joined: 10-December 08


Dream Kudos: 0

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 09:53 AM

View Postorangeinternet, on 14 Jun, 2009 - 09:34 AM, said:

I know your policy, i have researched it forever, and i was wondering if there was any simpler way (what i saw was very complicated)

Thanks



Then I would say that you need to learn up to the level of that. Just my thought's. Its not that hard just alot of reading and trail and error.
Was This Post Helpful? 0
  • +
  • -

#10 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • Icon

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


Dream Kudos: 650

Expert In: .NET

Re: Record Keystrokes in windows forms

Posted 14 June 2009 - 01:18 PM

don't forget that you need to set the "KeyPreview" property to "True" if you want the form itself to process keystrokes.
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