This question except i want to ask how do i make my picturebox not lose focus on keypress of the arrow keys. It gets focus when i overloaded it and set TabStop = true but the arrow keys are giving me problems.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That requires overriding the control’s IsInputKey() method. Quite a bit of additional surgery is required to let the picture box get the focus in the first place. Start by adding a new class to your project, make it look similar to this:
This ensures that the control can get the focus and can be tabbed to. Next, you’ll have to undo the attributes for the TabStop and TabIndex properties so the user can set the tab order:
Next, you have to make it clear to the user that the control has the focus so she’ll know what to expect when operating the cursor keys:
And finally you override IsInputKey() so that the control can see the arrow keys:
Compile. Drop the new control from the top of the toolbox onto your form.