Recent

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

pcurtis

  • Sr. Member
  • ****
  • Posts: 351
[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 / Linux Mint 20
Laz 2.10.0
FPC 3.2.0

lainz

  • Hero Member
  • *****
  • Posts: 3807
  • Leandro Diaz
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.
https://lainz.github.io/
Download LazPaint https://lazpaint.github.io/
Download BGRABitmap and BGRAControls https://github.com/bgrabitmap

pcurtis

  • Sr. Member
  • ****
  • Posts: 351
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 / Linux Mint 20
Laz 2.10.0
FPC 3.2.0

lainz

  • Hero Member
  • *****
  • Posts: 3807
  • Leandro Diaz
Re: BCButton - AssignStyle
« Reply #3 on: October 20, 2020, 03:26:32 am »
https://lainz.github.io/
Download LazPaint https://lazpaint.github.io/
Download BGRABitmap and BGRAControls https://github.com/bgrabitmap

 

TinyPortal © 2005-2018