Jump to content
Sign in to follow this  
Tntman

Global StyleBook component

Recommended Posts

I dropped StyleBook1 on form, i opened it and i edited progress bars,buttons and all other components that my custom style needs. Now i have to update my components to use styles that I made. Is there an option to add some type of global StyleBook component so all of my forms can access it ? I have around 20 forms and i dont want to drop new StyleBook on every form...

 

I was thinking to make some sort of invisible form ( that form will never be displayed ) where I will have my StyleBook component. After that I will include that form in every other form ( I have 20 other forms ) and try to access StyleBook that way..

 

What are your solutions ?  

Edited by Tntman

Share this post


Link to post

I use such "invisible" form in one of my projects.
So that the styles are still be able to edit there, sometimes to make custom edits.

I uses that form for editing, and removed all unneeded stuff later, but keep that StyleBook on that form for the whole application.

I'm not happy with that either, but it does its job, and its more convenient than to have a separate form elsewhere, just for designer purposes.
In a DataModule the stylebook designer didn't work as it should, at least you cannot edit any custom styles,

or is there any workaround to it ?

I doubt it, because DataModule is not visual.

Share this post


Link to post
57 minutes ago, Rollo62 said:

at least you cannot edit any custom styles

Yes, that is a drawback of using a datamodule. That said, different custom styles for the same controls inside the same application seems like inconsistent UI design to me.

Share this post


Link to post

I use custom styles only at the very minimum possible, but some controls unfortunately doesn't allow any other chance for tinting and re-coloring backgrounds etc.

Thats a pity, because if that would be possible I wouldn't need any custom styles at all.

I know , the styles were made exactly for that purpose, but its way too much efford to make a custom design, when simple fill/stroke/text colors will do the job.

  • Like 1

Share this post


Link to post

Here is what i figured out.

 

apparently, there is no need to add it to a data module. U can just drop stylebook onto any form edit components and put unique names for them. After that you can go on other from drop component and use StyleLookup property where you have to put unique name that you have in your StyleBook for that component, ofc before that you have to save your style... 

 

Conclusion is that stylebook is global if u save it, it just wont appear in stylelookup property dropdown, but if u put exact name it will glab a style.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×