Click here to Skip to main content
       

C#

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
QuestionHOW TO ANSWER A QUESTIONadminChris Maunder12 Jul '09 - 22:36 
Apologies for the shouting but this is important.
 
When answering a question please:
  1. Read the question carefully
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
  3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
  4. If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
 
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

QuestionHow to get an answer to your questionadminChris Maunder10 Nov '05 - 16:31 
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
     
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
     
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
     
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
     
  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
     
  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
     
  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
     
  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
     
  9. Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
     
  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
     
  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
     
  12. No advertising or soliciting.
     
  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

QuestionHow to use keyboard keys instead of mouse for space invadersmemberRuben X Ashley David3hrs 24mins ago 
Hi
 
I have a to make space invaders for school.
I can move the defender with the mouse and he also shoots with a mouse click but I also want to use the keyboard keys left, right and spacebar.
I don't know how to start for this, please help!
 
Thank you!
AnswerRe: How to use keyboard keys instead of mouse for space invadersprofessionalCollin Jasnoch2hrs 47mins ago 
Hey derp,
 
Not sure how you think we can "start" it for you. I mean I guess I could send you my paypal info and that could "start" something, but since your requirements posted are quite minimal I will keep the rate nice and low (relatively low for a HW assignment atleast).
 

Ok seriously though, what makes you think we would do your homework for you? While people may 'help' you with their homework (they will likely keep in very minimal... It is for you to learn not us to do) you have not posted ANYTHING that you tried. Stating you can get it to move with this and that but not what your assignment is will not get you anywhere even if someone were willing to do the entire assignment for you.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

GeneralRe: How to use keyboard keys instead of mouse for space invadersmemberRuben X Ashley David2hrs 31mins ago 
You don't have to do my homework :s I just can't find how to use keyboard keys instead of a mouse control...
 
This is my project http://pastebin.com/DVewwGmz[^]
GeneralRe: How to use keyboard keys instead of mouse for space invadersmvpDave Kreskowiak1 hr 58mins ago 
Well, then, it looks like you haven't looked through the list of events for the Form class. I wonder what the KeyDown and KeyUp events are for...

AnswerRe: How to use keyboard keys instead of mouse for space invadersprofessionalCollin Jasnoch1 hr 56mins ago 
There are a couple ways you can capture keyboard keys.
 
First which is more acceptable and easier is dependent on your UI stack (WPF, WinForms etc.)
Each have specific events they can listen to that you create from the UI/Design side and is pushed into your logic.
 
For example if it is WPF you can add the KeyDown and KeyUp events to any UIElement (window, custom control, textbox etc.)
 
You will then create (or auto create) an event in your code behind like this:
 
private void UserControl_KeyDown(object sender, KeyEventArgs e)
{
    //e.Key <-- the actual key which can be compared to Key.<TheKeyYouAreOrAreNotLookingFor>
}
 
The other is to make more of a global hook. A developer does this if they must capture all keys regardless of where the focus is (e.g. multiple window system but I need Ctrl+5 to do something specific)
 
Here is a decent blog post on how to do that.
 
http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx[^]
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

GeneralRe: How to use keyboard keys instead of mouse for space invadersmemberRuben X Ashley David1 hr 37mins ago 
Thank you Collin Jasnoch I will try that!
GeneralRe: How to use keyboard keys instead of mouse for space invadersprofessionalCollin Jasnoch45mins ago 
You're welcome and good luck Smile | :)
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

QuestionRe: Set Color of Pen and Brush [modified]memberASPnoob12hrs 16mins ago 
Hi All,
The Pen and the Brush objects' Color property needs to be set when they are created. The problem is the color values one can use is very limited. Is there a way to send the color code to the Pen or the Brush object dynamically after choosing a color from a palette? Thanks in advance for your reply.

modified 8 hrs ago.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 23 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid