Arrow keys work in opposite direction in panel

K

kuchuk

Hi,
I have a panel in my project (C# .NET 2003).
I have multiple radio buttons placed in it.
When I press UP Arrow key, The focus in the screen moves one radio
button DOWN. ofcourse if I press DOWN Arrow key the focus in the screen
will move one radio button UP. I guess this is because of the way the
radio button controls are arranged in the panel control collection.
Could anyone suggest a way to override this behaviour in a way that
when pressing UP Arrow key the focus in the screen will move one radio
button UP and so on...

TIA
Kuchuk
 
S

Stoitcho Goutsev \(100\)

kuchuk,

Yes, this is because of the order you add the radiobuttons to the container.
If you do it from code just revererce the order. If you have done it in the
designer that means you have added the radio button on the bottom first and
then the one obove ot and so on. If you use VS2005 it is easy to fix it -
use the 'Tab Order' tool and give the controls the correct order. It looks
like this tool actually changes the controls z-order - exactly what you need
here. If you use VS2003(2) it is not so easy. yuo need to use the 'Bring To
Front'/'Send To Back' commands that is not very easy. Alternatlively you can
change the code in the InitializeComponent.
 
K

kuchuk

Hi,
Already figured out the problem.
I add the radio buttons dynamicly in the code so all that was missing
is to assign the proper TabIndex for each button as I add it to the
container.
Thanks anyway,
Kuchuk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top