Hi all,
I'm trying to capture an event when tab is pressed in a textbox using visual studio.net, and am having a hard time. I can capture anything else, inluding the keys that are difficult like instert, alt, and the arrow keys. Here is the MSDN page that did not help: http://msdn.microsoft.com/en-us/library/system.windows.forms.keypresseventargs.keychar.aspx.

I have set up breakpoint for keyup, keydown, keypress, and leave events, but the tab key does not set them off. I capture the enter key this way:

void textBox1_KeyPress( Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e )
		if(e->KeyChar == '\r')
			MessageBox::Show("enter key pressed");

Thanks in advance.

Do you have the AcceptsTab property of the textbox set to true?

I was able to get it using

private: System::Void textBox1_KeyDown(System::Object^  sender, System::Windows::Forms::KeyEventArgs^  e) {
	if(e->KeyCode == Keys::Tab)
This question has already been answered. Start a new discussion instead.