Hi,
I created a custom control that inherits from textbox in a dll "WindowsControlLibrary". In my main project the custom control appears in the toolbox. I can drag it to the form OK, but if I click away from it to another control, I can't click back. But if I drag another control to the form, say a label, and then delete the label, focus jumps to my custom control again. Anybody know what is going on here?
Andy
AndyPosted Sep 6, 2007, 8:05 AM
Thanks for the reply. I was using an override ProcessDialogKey method in the class to handle enter key, etc. and I think that was somehow messing me up. When I commented it out, it worked fine. I have since been able to use an override ProcessCmdKey method with no problems. I'm not sure the difference...
Andy
Scott LyslePosted Sep 6, 2007, 12:47 AM
Andy:
You'd mentioned "WindowsControlLibrary" so I am not sure what you have; is this a user control? If you create a standard class and inherit TextBox, using no more code than what follows, I don't see that behavior:
using System; using System.Collections.Generic; using System.Text; namespace junk { public class XTextBox : System.Windows.Forms.TextBox { public XTextBox() { InitLayout(); } } }