all groups > c# > april 2004 >
You're in the

c#

group:

What am I missing (TabStop)


Re: What am I missing (TabStop) Michael McGuire
4/1/2004 5:18:36 PM
c#:
In WinForms, labels can't be a tabstop, so you don't need to set the
property.

However, you can use the TabIndex property of a label to provide a shortcut
key to another control that does act as a TabStop however.

For example:

TextBox1.TabStop = true;
TextBox1.TabIndex = 3;

Label1.TabIndex = 2;
Label1.Text = "&Some Value";

In your WinForm application, hitting Control-S should put focus right into
TextBox1. This assumes that you don't have another control with a TabIndex
of 3 also set and that you don't have other labels or menus with the
Control-S shortcut setup also.

[quoted text, click to view]

Re: What am I missing (TabStop) William Ryan eMVP
4/1/2004 7:06:48 PM
Are you in Winforms? It doesn't matter b/c you don't stop on tabs anyway.
[quoted text, click to view]

Re: What am I missing (TabStop) William Ryan eMVP
4/1/2004 11:41:31 PM
You can't stop on tabs so no worries there.
[quoted text, click to view]

What am I missing (TabStop) John Baro
4/1/2004 11:49:08 PM
Where is my TabStop property.
I want to prevent tabbing to a label.
In the MSDN it shows

Label.TabStop Property
This member supports the .NET Framework infrastructure and is not intended
to be used directly from your code.

And sure enough it is not accessible.

HUH?

BJ

Re: What am I missing (TabStop) John Baro
4/2/2004 2:29:40 AM
Am using winforms.
Tabs??
Dont want to be able to tab to a label.

[quoted text, click to view]

Re: What am I missing (TabStop) John Baro
4/2/2004 2:37:20 AM
Hi Michael

The problem is that I have a group box that has a label.
Normally I set the labels tabindex to be 900+ so it doesnt matter but in
this case it does because it is not doing anything becuase it is going to
the label and then presumably on to the next control in the group box which
is ???

**********
Solved.
**********

I set the tabindex to make the label before the textbox.
Problem is that this does not always work but I can make it work.
I set the focus to the next control in the keydown event of textboxes using
getnextcontrol and canfocus.
If the next control is a label this does not work because a label cannot
receive the focus.
Thats all right. If I always set labels in group boxes (or full stop) to be
the first items then it should be ok.
Hope I explained myself all right.
Probably not.

Thanks
JB :)

[quoted text, click to view]

AddThis Social Bookmark Button