Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a IToolControl derived control which contains a c# TextBox. In the IToolControl::OnSetFocus function documentation, it states that you need to call ICompletionNotify::SetComplete() when it's finished to let the application know that the control should lose focus.

On another IToolControl ComboBox control, I called the SetComplete() function on the DropDownClosed event.

On which TextBox event should I call ICompletionNotify.SetComplete()?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I guess an appropriate moment to call ICompletionNotify.SetComplete for a TextBox would be upon the user hitting the Enter key. That could be handled by subscribing to the KeyDown event and checking whether the KeyCode in event arguments equals to Keys.Enter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.