Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi, the focus method doesn't seem to work on page change.
I am using tabcontrol.

What I have tried:

I have tried to do textbox.focus() in methods Selecting, and SelectedIndexChanged, in both I have the focus() as last called method but it doesn't change the focus instead the focus is set on a button.
Maybe I am missing something?
Posted
Comments
Ralf Meier 21-Feb-24 5:39am    
perhaps you show us the relevant code ...
Is your Textbox on one of the TabPages or outside the TabControl ?
0x01AA 21-Feb-24 13:50pm    
Disable the timer again?
[no name] 21-Feb-24 15:09pm    
There are "tab / tab control" interaction "events" you should be working with. i.e. One can't focus what hasn't been fully "selected". Which may require storing inforation for a "future" event to act on ... i.e. (optionally) focus on "this"; or do that; "after" the selected event has fired. One must be aware of current state; and how it can change.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900