Thanks for trying to help me.
I'm not using a Tab control. I was referring to the TabIndex property of the
Button control (myBtn.TabIndex = ...)
The tab index determines the sequence of controls within the same hierarchy
level getting focus when hitting the <TAB> key.
Axel
-------
> I assume you are using the TabControl.
>
[quoted text clipped - 41 lines]
> > TIA,
> > Axel Dahmen
Alex,
Can focus is false because the all controls are not visible at the moment
the Load is being raised.
If you want to specify teh button that will have initialif the focus at this
very moment you can assign the button to the ActiveControl property. It also
works if you set the tab indices correctly
You say that the main pane has index 1 it makes mi thing that something
else has index 0 and this is what gets the focus.

Signature
Stoitcho Goutsev (100) [C# MVP]
> Thanks for trying to help me.
>
[quoted text clipped - 59 lines]
>> > TIA,
>> > Axel Dahmen
Axel Dahmen - 22 Apr 2005 00:16 GMT
Thanks, Stoitcho, it works!
I'm curious: So "ctrl.focus()" and "ActiveControl = ctrl" are more or less
equivalent?
TIA,
Axel Dahmen
-----------------
"Stoitcho Goutsev (100) [C# MVP]" <100@100.com> schrieb im Newsbeitrag
news:#A$NUIsRFHA.3560@TK2MSFTNGP14.phx.gbl...
> Alex,
>
[quoted text clipped - 73 lines]
> >> > TIA,
> >> > Axel Dahmen
Axel Dahmen - 23 Apr 2005 02:11 GMT
I don't get it: Sometimes it works, but most of the time it doesn't....
You wrote that there might be more than one control having TabIndex = 0.
This is only true for controls contained within a panel. This should be
correct, shouldn't it? Each panel creates its own TabIndex "scope", doesn't
it?
I remember a designer feature in VB6 and VC++6 creating correct TabIndex
values for me. Isn't a thing like that available in VS7?
TIA,
Axel Dahmen
-----------------
"Stoitcho Goutsev (100) [C# MVP]" <100@100.com> schrieb im Newsbeitrag
news:#A$NUIsRFHA.3560@TK2MSFTNGP14.phx.gbl...
> Alex,
>
[quoted text clipped - 73 lines]
> >> > TIA,
> >> > Axel Dahmen
Stoitcho Goutsev \(100\) [C# MVP] - 25 Apr 2005 23:24 GMT
Axel,
Yes, each container creates it own scope for the TabIndex. You can have two
control's with tab index 0 as long as they belong to different containers.
Why some times works some times not I cannot say unless we have some working
code to work on. If you write some compilable code that demonstrates the
problem I'll more than happy to help you.

Signature
Stoitcho Goutsev (100) [C# MVP]
>I don't get it: Sometimes it works, but most of the time it doesn't....
>
[quoted text clipped - 99 lines]
>> >> > TIA,
>> >> > Axel Dahmen