MikeZ87 1 Posted June 3, 2023 Hello, I'm trying to create a combobox that I can style to look like this. I'd **LIKE** to do it solely in the WYSIWYG style designer. Can anyone point me to a tutorial on how even to change the font size in the Style designer? I'm admittedly such a noob in this, but I'm at a total loss. Thanks. - Mike Share this post Link to post
programmerdelphi2k 237 Posted June 3, 2023 (edited) @MikeZ87 normally, you can do it using "Edit Custom Style" (right button on component), but in ComboBox, in fact, the items is a "ListBoxItems", and there is not a property to change it in StyleBook... that way, you can just right-click on ComboBox, and select each item and change the property on Object Inspector, or by code like this: for var i: integer := 0 to (ComboBox1.Count - 1) do begin ComboBox1.ListItems[i].StyledSettings := []; // remove parent styles... ComboBox1.ListItems[i].Font.Size := 28; // changing the properties... end; exists a "delay" before show new setting... Edited June 3, 2023 by programmerdelphi2k 1 Share this post Link to post
programmerdelphi2k 237 Posted June 4, 2023 (edited) Sarina Dupont has a video about Style Designer Bitmap Style Designer with Sarina DuPont - CodeRageXI Ray Konopka Customizing Controls with FMX Styles, with Ray Konopka https://youtu.be/j9XxM7W94p4 Edited June 4, 2023 by programmerdelphi2k 1 Share this post Link to post
MikeZ87 1 Posted June 4, 2023 OMG!!! ProgrammerDelphi2K!!!! OMG!!! THANK YOU!!!!! That's EXACTLY what I was looking for. I knew about the listitems, but couldn't put 2 and 2 together to figure that out. THANK YOU SO MUCH!!!!! It's working now! Much appreciated! Share this post Link to post
programmerdelphi2k 237 Posted June 7, 2023 (edited) @MikeZ87 I found easy way to changes all "ITEMS" in ComboBox / ListBox using StyleBook setting/object - no needs code anymore! all that you need is open any "style file in your StyleBook", you can find in your Embarcadero Style folders in c:\users\Public folder now, find the object named "listboxitemstyle" and "COPY" this object will have all setting to change your "ITEMS", in ComboBox and/or ListBox together just close all go back to your project/form where is your "StyleBook" component double-click to open it now, just "PASTE" your new object (named "listboxitemstyle") now, do the changes... Edited June 7, 2023 by programmerdelphi2k Share this post Link to post
MikeZ87 1 Posted June 7, 2023 That actually does make it A LOT easier. Thanks! I was going to ask you - after playing with this a little bit, I notice that the main text (ie: the text of the itemindex item) is BIG (like the style,) but the drop-down text is still tiny. How can I change the font size of the drop down text? Thanks again A MILLION!!! - Mike Share this post Link to post
programmerdelphi2k 237 Posted June 8, 2023 (edited) @MikeZ87 well, the "Styles" (old Skins, Themes, etc....) is a new way to put "color and actions" on GUI of apps, and honestly, it's a black box with too many ramifications to venture to master it!.. to understand a little more you needs use a StyleBook and testing each elements... you can "copy" all elements started with "listbox..." found in any Style like I said above... and search each "text" object and test it... Edited June 8, 2023 by programmerdelphi2k Share this post Link to post
programmerdelphi2k 237 Posted June 8, 2023 @MikeZ87 sometimes you need to do a little "hack" ... if possible... look, StyleBook + Hacking class TComboListBox used by ComboBox in FMX ListBox using ItemHeight = 100 ComboBox using (ListBox) ItemHeight = 60 + colors 1 Share this post Link to post
Minox 7 Posted June 8, 2023 6 hours ago, MikeZ87 said: That actually does make it A LOT easier. Thanks! I was going to ask you - after playing with this a little bit, I notice that the main text (ie: the text of the itemindex item) is BIG (like the style,) but the drop-down text is still tiny. How can I change the font size of the drop down text? Thanks again A MILLION!!! - Mike Have you tried changing the "Scale" property? in some cases it may be fine Share this post Link to post
programmerdelphi2k 237 Posted June 8, 2023 6 hours ago, Minox said: in some cases it may be fine can you show it? in code and moving? (like above) Share this post Link to post
Rollo62 539 Posted June 9, 2023 Be aware that the editing structure of styles and their subcomponents were not necessarily compatible under all platforms. Which is the biggest headache in FMX styles IMHO. Share this post Link to post
amit 3 Posted June 29, 2023 (edited) Follow the suggestion from programmerdelphi2k, I finally found all New Comboboxes or Listboxes will be got effect on new Text Size and Color settting in ListboxItemStyle. It is global effect to all components that Listboxes associated with. I try to rename listboxItemStyle to cboListboxItemStyle in Edit Custom Style and save, then all comboboxes and Listboxes were reset to default no style applied to them. So I try to apply the cboListboxItemStyle during runtime using this code but it has no effect. for var i: integer := 0 to (ComboBox1.Count - 1) do begin ComboBox1.ListItems[i].StyleLookup := 'cboListboxItemStyle'; end; So it seems combobox.listbox were fixed to ListboxItemStyle only. It cannot be customized. I need to know if there is a way to individually customize combobox and listbox. Edited June 29, 2023 by amit Share this post Link to post
programmerdelphi2k 237 Posted June 29, 2023 7 hours ago, amit said: I need to know if it is a way to individually customize combobox and listbox. A "ComboBox" is a container to items = ListBoxItems, for that the styles is applyed on items, not necessary in the container! try use Styles customizations on Combobox -> right-click on ComboBox and Edit Styles customs... and do the changes... 1 Share this post Link to post