TMSFMXBarButton kind retention


I am not sure if i am using this component correctly. I place the button on a TPabel and change the TMSFMXBarButton kind to bkDelete , the button presentation is changed. But when I run the app the kind is not changed. It shows up as bkNormal. How do I keep the kind property of TMSFMXBarButton changing back to bkNormal at runtime.

Thanks,
Avanish

Nevermind , i needed to set AllowCustomize to false


Avanish

I am not able to set text on the button in this mode while setting my own button kind property. Please suggest way to customize the kind and text of the button.

Avanish

can you send us a sample project that demonstrates this ? Or post your code

This would be easier for us to understand what properties have been set and what code you are using the change the text.

Kind Regards, 
Scheldeman Pieter

Hello,

 
I also would like to know if it is possible to set a the button kind for example to bkDelete but still
have a custom text/caption?
At the moment the button always shows, in that case, "Delete" as caption and not the text that is given by me.
 
best regards,
 
Thomas 

Yes, that is possible. You need to use the OnApplyStyleLookup event:


procedure TForm1.TMSFMXBarButton1ApplyStyleLookup(Sender: TObject);
begin
  TMSFMXBarButton1.Kind := TTMSFMXBarButtonKind.bkDelete;
  TMSFMXBarButton1.Text := 'test';
end;

Hi,


At the moment I have set the TTMSFMXBarButton ShowText property to false and added a TLabel on top of the button to achieve this.

Best Regards,
Avanish