Click here to Skip to main content
15,919,341 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Fill Datagridview in one form From Another Datagridview Form Pin
wkalo5-Sep-12 9:33
wkalo5-Sep-12 9:33 
QuestionText_Changed Calculation error Pin
garyu871-Sep-12 20:24
garyu871-Sep-12 20:24 
AnswerRe: Text_Changed Calculation error Pin
garyu871-Sep-12 21:48
garyu871-Sep-12 21:48 
QuestionSecuring Local Files [Solved] Pin
Saul Johnson1-Sep-12 11:59
Saul Johnson1-Sep-12 11:59 
AnswerRe: Securing Local Files Pin
AspDotNetDev1-Sep-12 15:26
protectorAspDotNetDev1-Sep-12 15:26 
GeneralRe: Securing Local Files Pin
Saul Johnson1-Sep-12 23:13
Saul Johnson1-Sep-12 23:13 
GeneralRe: Securing Local Files Pin
dcu.lcr4-Sep-12 4:20
dcu.lcr4-Sep-12 4:20 
GeneralRe: Securing Local Files Pin
Eddy Vluggen4-Sep-12 5:16
professionalEddy Vluggen4-Sep-12 5:16 
GeneralRe: Securing Local Files Pin
dcu.lcr5-Sep-12 2:37
dcu.lcr5-Sep-12 2:37 
GeneralRe: Securing Local Files Pin
Eddy Vluggen5-Sep-12 3:22
professionalEddy Vluggen5-Sep-12 3:22 
AnswerRe: Securing Local Files Pin
Eddy Vluggen1-Sep-12 22:51
professionalEddy Vluggen1-Sep-12 22:51 
GeneralRe: Securing Local Files Pin
Saul Johnson1-Sep-12 23:18
Saul Johnson1-Sep-12 23:18 
GeneralRe: Securing Local Files Pin
Eddy Vluggen2-Sep-12 0:28
professionalEddy Vluggen2-Sep-12 0:28 
AnswerRe: Securing Local Files [Solved] Pin
James H3-Sep-12 22:21
James H3-Sep-12 22:21 
GeneralRe: Securing Local Files [Solved] Pin
Saul Johnson5-Sep-12 4:07
Saul Johnson5-Sep-12 4:07 
AnswerRe: Securing Local Files [Solved] Pin
Stephane Rivette At Motion4-Sep-12 2:07
Stephane Rivette At Motion4-Sep-12 2:07 
GeneralRe: Securing Local Files [Solved] Pin
Eddy Vluggen4-Sep-12 5:15
professionalEddy Vluggen4-Sep-12 5:15 
AnswerRe: Securing Local Files [Solved] Pin
BrainiacV4-Sep-12 8:30
BrainiacV4-Sep-12 8:30 
GeneralRe: Securing Local Files [Solved] Pin
Saul Johnson5-Sep-12 4:05
Saul Johnson5-Sep-12 4:05 
AnswerRe: Securing Local Files [Solved] Pin
ObiWan_MCC5-Sep-12 3:51
ObiWan_MCC5-Sep-12 3:51 
GeneralRe: Securing Local Files [Solved] Pin
ObiWan_MCC5-Sep-12 4:02
ObiWan_MCC5-Sep-12 4:02 
GeneralRe: Securing Local Files [Solved] Pin
Saul Johnson5-Sep-12 4:03
Saul Johnson5-Sep-12 4:03 
GeneralRe: Securing Local Files [Solved] Pin
ObiWan_MCC5-Sep-12 4:36
ObiWan_MCC5-Sep-12 4:36 
QuestionArrow keys to move an object Pin
Steven St. John1-Sep-12 11:30
Steven St. John1-Sep-12 11:30 
Having trouble getting exactly the answer I need in google, MSDN.

Desired: A user can select a PictureBox on the form which becomes the activeBrick. Whenever there is an activeBrick selected, arrow keys should move this one pixel at a time around the form within a Panel control called pnlTableau.

I have done this:

Me.KeyPreview = true


My attempted solution was this:

Private Sub BrickMove(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp

    If activeBrick IsNot Nothing Then
        Select Case e.KeyCode
            Case Keys.Up
                If activeBrick.Top > 0 Then activeBrick.Top -= 1
            Case Keys.Down
                If activeBrick.Bottom < pnlTableau.Height Then activeBrick.Top += 1
                e.Handled = True
            Case Keys.Left
                If activeBrick.Left > 0 Then activeBrick.Left -= 1
                e.Handled = True
            Case Keys.Right
                If activeBrick.Right < pnlTableau.Width Then activeBrick.Left += 1
                e.Handled = True
        End Select
    End If
    Me.Refresh()
End Sub


The Me.Refresh line at the end is because my active PictureBox has a dotted red rectangle around it, which will "drag" if the form is not repainted.

The problem: I have a few radio buttons on the form also. The arrow keys DO move the PictureBox, but the arrow keys also shift the selected radio button, which is not behavior I want. I thought e.Handled = True would suppress this, but it doesn't.

If I move this code to the KeyDown event, the PictureBox does not move at all but the radio buttons are still selected.

Thanks in advance.
AnswerRe: Arrow keys to move an object Pin
ChandraRam2-Sep-12 23:57
ChandraRam2-Sep-12 23:57 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.