Hello everybody!

In our application we have a row of panels that act as a navigation panel -
looking similar to a tree.

It works fine, all the panels can be clicked and the related action is
performed.

It got a requirement that this control must be accessable by keyboard, so it
must have something like a focus.

Any ideas how to get out of this mess?

I am new to .NET and C#.

Christoph

Re: Panel SetFocus by Herfried

Herfried
Tue Jul 19 09:45:00 CDT 2005

"Ladachris" <Ladachris@discussions.microsoft.com> schrieb:
> In our application we have a row of panels that act as a navigation
> panel -
> looking similar to a tree.
>
> It works fine, all the panels can be clicked and the related action is
> performed.
>
> It got a requirement that this control must be accessable by keyboard, so
> it
> must have something like a focus.

Panels are conainer controls and cannot get the focus. I suggest to use
another control like the button control instead of the panel controls. You
can override the button's 'OnPaint' method in order to draw it the way you
want it to appear.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: Panel SetFocus by Phil

Phil
Tue Jul 19 15:03:57 CDT 2005

It you must use the Panel then you should derive a class from it and inside
the constructor you can set the ControlStyles.Selectable so that it can
receive the focus. But probably a better solution would be to create a new
custom control by inheriting from UserControl instead.

Phil Wright
Follow my C# microISV startup at...
http://componentfactory.blogspot.com

"Ladachris" <Ladachris@discussions.microsoft.com> wrote in message
news:B56E3BE8-1AB5-4579-BF28-D2A549776B92@microsoft.com...
> Hello everybody!
>
> In our application we have a row of panels that act as a navigation
> panel -
> looking similar to a tree.
>
> It works fine, all the panels can be clicked and the related action is
> performed.
>
> It got a requirement that this control must be accessable by keyboard, so
> it
> must have something like a focus.
>
> Any ideas how to get out of this mess?
>
> I am new to .NET and C#.
>
> Christoph