Hi all. I'm trying to get a hotkey control working in C# based on both the Control class and the msctls_hotkey32 win32 class. What I have works, though it's not perfect:
class Hotkey : TextBox
{
protected override CreateParams CreateParams
{
get
{
CreateParams parms = base.CreateParams;
parms.ClassName = "msctls_hotkey32";
return parms;
}
}
// (some other p/invoke stuff for HKM_SETHOTKEY, etc.)
}
The advantages are that it's simple and it works. The disadvantage is that it inherits a bunch of functionality from TextBox that doesn't apply to this control. So my question is - is there a better way to do this without reinventing the wheel?
Thanks.