Ok, here is the issue:
Recently I hit an problem that I was not able to use Accelerator Keys ( a.k.a HotKeys ) on Buttons inside GroupBox. Just a minute ago I found out why, but now only problem is that this reason makes me even more puzzled than before, which is that Such button with accelerator cannot be found on Form. Effect is that when I double click to affected buttons with double-click while in Design-time, I get error “Property and method are not compatible”.
MethodName is VKPInputBtnClick, that is actually declared as function, not as Method in Unit.
What makes me puzzled is that I have not assigned OnClick event handler for VKPInputBtn to any Method at all!
How it is possible that I can compile program and have no run-time problems … but in Design-time double click on button has such annoying issues ….
Any solution? Reinstall of IDE?
Any help much appreciated …
Double-clicking a control that doesn’t have its default event property set causes the IDE to assign that property. (It’s not just a shortcut for going to the code editor; that’s F12.) The IDE searches the source code for a function with the desired name. If it doesn’t find one, then it creates a method in the containing form and assigns it to the component’s event property. But if it does find something with the right name, it attempts to assign it without creating anything new.
The problem, apparently, is that the thing the IDE finds in your case isn’t compatible with the event it appears to go with. Probably a bug — it shouldn’t select non-methods — but a rarely encountered one given the low frequency with which humans choose the same name for standalone functions as the IDE chooses for event handlers.
You have several options:
VKPInputBtnClickso it doesn’t look like it’s theOnClickevent handler for theVKPInputBtncontrol.VKPInputBtnClickbe a method of the form class.VKPInputBtnClickmethod in the form class, and maybe the IDE will select it instead of the standalone function.OnClickproperty in the Object Inspector, and then double-click it (or press Enter). The IDE will create a method with that name.