vb.net controls:
Hello,
I'm displaying a form which has a TextBox for the user to type a search
string, and then a ListView containing all the entries that can be searched.
When the form is first displayed, all the entries are pulled from the
database and inserted into the ListView. As the user types a string in to
the TextBox, the ListView Item's are searched and the closest match is
automatically selected.
I am using the TextBox_KeyDown event to check for when the user presses Tab.
When Tab is pressed, the SortColumn of the ListView is changed. I quickly
discovered that I must disable the TabStop property on all of the objects in
order to capture the Tab key.
The problem is that when the form is first displayed, I want to focus the
cursor on the TextBox so that the user can just start typing right away.
The New constructor has TextBox.Focus() as it's last line, but it doesn't
work. If I set TextBox.TabStop=True, then it works and the TextBox is
focused right away, but then I can't capture the Tab key.
I need to either come up with a way to capture the Tab key while having
TabStop=True on some of the form objects, or else find a way to force the
TextBox to automatically be focused when the form is first displayed.
Any suggestions on how I can accomplish this?
On another note, how can I differentiate between Tab and Shift-Tab when
using the KeyDown event?
--
Jason Hunt
Advanced Computer Systems