Make usercontrol that doesn't steal focus
-
I've made a simple user control that has two properties and 3 different states. I'd like to prevent this control from accepting focus. Basically I want it to act like a label or panel. I've tried overriding wndproc, but haven't had any luck. All research has also turned up nothing. Any help would be appreciated.
-
I've made a simple user control that has two properties and 3 different states. I'd like to prevent this control from accepting focus. Basically I want it to act like a label or panel. I've tried overriding wndproc, but haven't had any luck. All research has also turned up nothing. Any help would be appreciated.
If the label class does what you want, why not just derive from that ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
If the label class does what you want, why not just derive from that ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
I suppose because I'm stubborn :) Actually, I hadn't thought of that. In my fiddling I stumbled across a different solution. It seems a UserControl inherits from UserControl and a custom control inherits from Control. A UserControl will recieve focus when clicked, but a Custom control won't. I'm assuming Usercontrol inherits a class that handles the focusing, which is why that type of control will always focus. I tried researching what the differences could be but came up empty handed. So now I know in a situation like mine just inherit from control if I don't want it to get focus. I've discovered another mystery in my pointless pursuit of information. How come the TabStop property doesn't exist for labels? TabStop is a property in the Control class and a Label is a control. How could it not be there? Oh, well. Unless somebody knows, I give up. I've figured out what I needed to know. Thanks for your reply.