DockTop, ZOrder and TabIndex

E

Eu Man

Hello there
in my .NET Compact Framework 2.0 SP2 C# WM 5 Smartphone application, I've a
form with some panels, all panels are Dock = Top and in any panel there is a
TextBox.

I need this layout because depending on some settings we hide or show some
panels and in this way the panels are always visible and stacked from the
top without empty spaces.

the problem is that with this design, the tabindex is ignored and the focus
moving is flipped so to go down I should use the up button (actually moving
the joypad of my qtek 8310) and to go up I should use the down button.

Any Idea ?
I don't want to grab or handle the Got/Lost focus events because many
controls (textboxes) can be hidden and if so I should write more and more
code....

best practices ? I simply want to use down arrow to pass the focus in the
next panel but it seems the down panel has higher zorder so to go down I
have to go up ??!?! :-(((

Thanks in advantage, sincerely, Davide.
 
A

Arun

Hi Davide,

Just add the panel and set the taborder to the panel in reverse order.
something like this
for (int j = i - 1; j >= 0; j--)
{
objPanel[j].Parent = this;
((Control)objPanel[j]).TabIndex = j;
}
Panel doesn't have Tabindex so casting required.
Lets say i is 10(panels), you would have added in reverse Z order to
its parent, then set the tabindex to the panel in the same order.

Hope this helps,
Cheers,
Arun
 

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

Similar Threads


Top