You have to realize that everything that uses a new style must respect a new way of being. So when you use a style you will be overriding an old style, so you must change the properties in the new style.
You can do this by accessing the element responsible for the new presentation of the object by accessing the StyleBook and changing the definitions of the desired property. It is also possible to do this in code, but it is more laborious and requires knowing the property used internally in the style.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
you need find the property used by ComboBox...HEIGHT Layout is a container used by style-definition... not by ComboBox itself.
tip: open any style file in ..Public\Embarcadero\....\Styles and see what is the ComBox or ListBox property used ...
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
all project should be designed in "DEFAULT" view = MASTER VIEW all others is used to better acomodating of visual components on forms when using styles, you can change the properties that you needs.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
all class is composed by another class, normally. then a Combobox have many parts, like: Edit to type your entry, PopUp to open and show your items, Listbox to store your item, etc... in ComboBox, we have a "ListBox" that store your item... for that you need works there.
for easy way : 1) put a StyleBook in your form 2) now, open a style file from Public\Embarcadero\...\Styles folder 3)now, copy all elements to ComboBox and ListBox ( like me above) it's ready... now you can works in your properties like me above
NOTE: When you change any property on style editor, you NEEDS APPLY IT to go back on the form. the STYLE MANAGER search for "property names" specifics in lowercase... for that youneed always use this names for stylename in styles.
此帖子包含附件: 大小:342.2K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
@emailx45 Thank you very much. Is your style file in this folder?
But now there is another drawback: in the Android environment, the combobox item is invalid except the d ropdownkind is set to custom. If there are many items, it will slow down the speed
I made the modification by right-clicking on the item in the listbox and selecting edit custom style. However, after the modification, it only works for the listbox. I don't know why it doesn't work for the combobox. The combox. item and the listbox. item use the same style, don't they? And I found that the style opened by right-clicking here has three more things compared to yours. What are the differences between edit custom style and edit default style?
Internally, Delphi has a default definition for the styles of each visual component, all via code or via resource files, it doesn't matter. That's why the "DEFAULT style" exists, when you don't use the "StyleBook" or any other means for that, for example, by code.
In this way, Delphi will always apply a style to its visual components, so it uses to search the components and their children, for certain types of objects with certain names, for example: searches for an object called "text" in a certain type of component or part of it.... thus, it knows what characteristics the text of that "xxx" object will have when it is used.
When you create a "custom style", you are telling Delphi that component "X", from now on, will use these features instead of the default features. However, only for "that visual component that you determined".
When you use "default style" then you are telling Delphi to overwrite the characteristics for all components of that same category when using your form or perhaps even your application if the style is used globally.
The ComboBox, as I said before, uses several other components/classes to show that look on the screen, for example: to edit the text, it uses an "EDIT"; to open and close the options, it uses a "Popup"; to show the items, it uses "ListBox", "ScrollBox", etc... it can be many others internally.
So, that's why the style used by "ComboBox", has so many objects internally. If you open which ".Style" file you will see that there are dozens and dozens of objects, and, for a given component, there can be many objects in the style.
For example, for the ComboBox, you will see 8 TLayouts, and within them are other objects, which will actually make the magic happen: colorlistboxitemstyle, comboboxstyle, comboeditstyle, combopopupstyle, listboxfooter, listboxitemstyle, listboxplainheader and listboxstyle; The "TLayouts", are just the containers that contain the real objects that transfer their characteristics to your visual component on your screen. These are the objects that Delphi looks for in your application. When it finds the type of object with the name "standardized" (always in lowercase letters), it uses it to define the new characteristics of its components on the screen. Therefore, you must always use the object types and with the standard names defined by Embarcadero.
The easiest way for you to know which objects are used by a style is to open a style file that is not in your folder: C:\Users\Public\Embarcadero....\Style If you want to create your own styles, you can use the Style Editor from the menu "TOOLS -> Bitmap Style Designer"
You can create a style easily without any code: 1) place a desired object on your form to create your style, for example, see the video below The most important part is to use the same names for the "STYLENAME" of the objects used on the screen.
此帖子包含附件: 大小:1.42M
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
see the picture in 8楼: post
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
很多人使用MSWindows,但是,很多人讨厌MSWindows....在这种情况下什么是正确的呢? ------ When a plane crashes, it could be because of a lack of fuel... or because the pilot died in the cockpit!
So, if your software has stopped it could be because it doesn't agree with your coding... it would be better to review your code, wouldn't it?
Many people use MSWindows, however, many people hate MSWindows.... what is right in this situation?
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
can you upload your unit (.pas) for analize? im curious about it.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
Well, if you say you don't know where to start, then we already have the main cause of your problems, that is, you got lost in your coding and we can see that Delphi is not, at this moment, the cause of your problems. As I said before, it's time to review your coding.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
@Emailx45, thank you very much. For example, I would like to modify the customstyle of this button. Why are there some attributes such as bold and strikeout that can be set, but the size and color of the font cannot be changed
the easy way to do this is "rigth-click" on button and "Edit custom style..." ... then, change what you need. this create a "personal custom style for this button, only! if dont want that button receive changes, then you need overrite the methods necessary, or disable the control to receive write.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
always do the changes and "close style screen and APPLY changes" <----
anything try see your form in TEXT-mode (ctrl f12) if something is worng on resources...
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
RAD Studio has many black boxes that are not easy to understand as they use advanced programming patterns, and for beginners it is very difficult to understand, I am also not very familiar with them.
As you may be aware, when you use a style, you are overriding the component's default style. Likewise, when you change the properties of a component that uses a style, you will be overriding some of those properties. So, you must study which ones are overlapping and which ones are not, and thus begin to understand this game of chess.
In the case of colors, you should notice that there are more than one properties that are related to them, that is, if the component has focus, if it doesn't have focus, if it was pressed, if the mouse is above it, etc. can be used depending on each component and configuration.
This way, the color of the text is no longer the only point at this point. In the old days, when you only had the VCL, there were also these same situations, however, they were little noticed by beginners.
Now, in FMX this is much more evident because the same code serves for more than one final platform.
此帖子包含附件: 大小:2.35M
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
@Emailx45, I understand. Thank you very much. Originally, these colors are interconnected, and there are two sets of settings. One is for the control itself, and the other is for the stylesettings. To make the style effective, you must check the corresponding options in the stylesettings.
----------------------------------------------
-