W7 Toolbar Buttons


Using the new W7 toolbar and toolbar buttons and having an issue with enabling and disabling in code. When disabled in the IDE at design time and run, behaviour is normal. When button is disabled in code at runtime, the control paints like it is disabled, but still allows the button to be focused and clicked, giving an error "Cannot focus a disabled or invisible window".


Are you using the latest version of the components?

We can't reproduce a problem here with code:

procedure TForm4.Button1Click(Sender: TObject);
  W7ToolButton1.Enabled := not  W7ToolButton1.Enabled;

this behaves as expected. The button can't be clicked when disabled and doesn't cause an error.

Installed component pack on Delphi XE, the toolbar button version is Interesting it doesn't happen for you, I grabbed your W7 demo form and set the button to disable at runtime with the same result, so it wasn't just in my app.

If it helps  I can send that form and the compiled demo so you can see it happen.


Are you sure you first did a complete uninstall? The latest version we have in our distribution packages is

Fixed in v1.0.1.1 : Issue with changing Enabled property from OnClick event

Though I had! will go and clean out the cupboard so to speak... 

Just did a complete re-install (using uninstall provided and confirmed all files were removed)and re-install and still have version of that component on my form! is it possible to get the upgraded version as it looks like it didn't get included in my version component pack.

Question was answered by direct email.