Recent

Author Topic: [REOPENED] BCButton - AssignStyle - AssignFromFile('abc.btn')  (Read 714 times)

pcurtis

  • Hero Member
  • *****
  • Posts: 951
[REOPENED] BCButton - AssignStyle - AssignFromFile('abc.btn')
« on: October 19, 2020, 08:36:41 pm »
Hi All,

1. How do I assign a style to a TBCButton (created at runtime) in runtime?

2. Can I load the btn file from a resource?

Thanks in advance.


The answer to the first part is -

First create the style and save it
Code: Pascal  [Select][+][-]
  1. MyBCButton.SaveToFile('abc.btn');

then

 
Code: Pascal  [Select][+][-]
  1. MyBCButton.AssignFromFile('abc.btn');
« Last Edit: October 20, 2020, 02:52:30 pm by pcurtis »
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: BCButton - AssignStyle
« Reply #1 on: October 20, 2020, 01:53:52 am »
There are many ways. But I prefer setting the style by code using the properties. There are a lot of examples in the test folder, please check that.

pcurtis

  • Hero Member
  • *****
  • Posts: 951
Re: BCButton - AssignStyle
« Reply #2 on: October 20, 2020, 03:06:14 am »
I'm sorry but I can't seem to find any direct reference to loading styles.

The closest I have is MyBCButton.LoadFromFile('abc') but this only works with files created by MyBCButton.SaveToFile('abc'). How can I load a style from the styles dir e.g. google-search.bcbtn?
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: BCButton - AssignStyle
« Reply #3 on: October 20, 2020, 03:26:32 am »

 

TinyPortal © 2005-2018