Change Tabindex

Asked

Viewed 84 times

1

How do I get back the TabIndex of a Form for a given position?

I tried to use the this.ActiveControl.TabIndex = 0;, but it didn’t work out.

1 answer

0

That’s not possible. By the way, the way you’re doing, you’re trying alter the Tabindex of active control, being that what it needs is precisely change control currently active.

What you can do is set the property ActiveControl form.

For example:

this.ActiveControl = this.textBoxBusca;

If you want much select the control by your Tabindex, you work with LINQ for this. Just for the record, I find this approach extremely unnecessary.

var controle = this.Controls.First(c => c.TabIndex == 0);
this.ActiveControl = controle;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.