Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27412

VS 2022 Non-restricted movement between buttons

$
0
0
Hi there :)

I am creating a Windows Forms App .NET with VB in VS, and I have 4 buttons arranged in a square (2 rows and 2 columns).
I would like to have free movement between the buttons using the arrow keys, so that when the upper left button has focus
I can move focus to the lower left button with the down arrow, or to the upper right button using the right arrow.

I already sat the focus to be on the upper left button when the form is shown, and I have tinkered a little bit with the
TabIndex and the TabStop, but can't seem to get 100% free movement.

Also, I have tried using a KeyDown event on the button, like this:

If e.KeyCode = Keys.Down Then
Button4.Focus()
End if

But it does not work...

Any ideas?
Thanks! :D

Viewing all articles
Browse latest Browse all 27412

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>