Change the selected colour of combo box in delphi firemonkey - delphi

I have created application using Delphi 11.2 firemonkey for windows. In that i'm using Combobox. When the list opens, the background color of the items is blue by default, I would like to change this color
change the background color of the items

I agree with Steve, changing style for the combobox item style is really hard. You have to, first, access to the underlying listbox (hiden in the TCustomComboBox parent), and then change the ListboxItemStyle.ActiveStyleObject (I guess). This is not a good way I think.
I prefer a different approach : using a TEdit joined to a TlistView (or a Tlistbox)
my French blog here
this way it's easy to play with colors (look at some others posts in the same blog)

Related

Can I use the new Delphi VCL styles to simply color a specific object (TPageControl) alone?

I am starting with Delphi VCL styles and I see that it is very easy to apply a predefined style using 'Project | Options' and then 'Application | Appearance'.
Naturally these styles affect the whole look and feel of the Application. I would like to keep the default Windows style (I'm using 'Runtime themes enabled') but I want to change the default white background shown by TPageControl. I came across this excellent article on creating colourful page control tabs which shows how to override the colouring of the tabs, but it seems to apply only when a style is loaded.
My question is how (whether?) I can use TStyleServices without loading a style file to get at only the TTabSheet components and set a colour?
(And yes, I know that there are a number of other TPageControl replacements available, I want to stick with the standard controls).
You can access the elements (colors, images) of the loaded VCL Styles in anytime even if the Windows native style is active.
var
LStyleServices : TCustomStyleServices;
begin
LStyleServices:=TStyleManager.Style['AnyLoadedVclStyle'];
//draw with the LStyleServices
....
end;
But only you can use the Vcl Style hooks to draw the controls when a custom style is selected.

VCL style mac look style designer

Recently I've been doing some research in to VCL Styling (Embarcadero XE2 for Delphi).
I can load and set the styles so that works fine.
Currently I'm exploring the VCL Style Designer and what I try to figure out is how can I move the minimize, maximize, resize, close and help button to the left instead of the current default right while the application text (caption of the form) is on the right.
I am at my whits end and hope some one can give me some pointers.
So basically what I try to 'emulate' is the Mac look on a Windows form.
Any help is welcome.
What do you want accomplish is not related to the VCL Style Designer, instead you must create a custom form style hook.
Follow these steps.
Create (and register) a new form style hook descending from the TFormStyleHook class.
Override the PaintNC method to draw the title buttons in the new positions.
Handle the WM_NCMOUSEMOVE, WM_NCLBUTTONDOWN and WM_WM_NCLBUTTONUP messages to detect the status of the title buttons (hot, pressed) and fire the actions (close, restore, maximize, minimize).

Delphi XE5 Android TButton colors

I need change color of 50 buttons in one form.
Every button another color and color want to set by code(no design editor).
It is firemonkey mobile application.
By my opinion, without making your own button that doesn't use FMX styles completely (which would break multiplatform compatibility if you are looking forward to support multiple platforms with their native styles), you may apply some filter on top of each of those buttons but on some styles this may cause the text not to be visible, implementing your own filter might get you the desired result:
Effect:=TFillRGBEffect.Create(Self);
Effect.Color:=$80FF0000;
Effect.Parent:=SomeButton;
Another way would be to take advantage of TColorButton with TText on top of it, but this way the entire button won't be filled with your color, but you can modify default/custom style for each platform in order to get what you need (this indeed needs to be done in the designer but you would have to create just one style for each platform you need to support and not 50 for each button):
Button:=TColorButton.Create(Self);
Button.Color:=$80FF0000;
Text:=TText.Create(Button);
Text.Parent:=Button;
Text.Align:=TAlignLayout.alClient;
Text.Text:='Hello';
Text.HitTest:=false;
Button.ClipChildren:=true;
Button.Parent:=Self;

how to make Delphi tlistview work like explorer

Windows Explorer has some behaviors that I would like to replicate in a themed application for a Delphi TListView.
(This works fine if I don't have themes for the list view, but I'd rather have themes if at all possible)
In Windows Explorer, when I click in the white space around an icon I can still make a dragover box and when I right click I get the popup menu for the container, not the icon.
With themes on, the selection grows to the entire bounding box of the item in the list, with themes off it shrinks to fit the size of the text in the list item.
What do I need to do to have themes:
But keep them working like no themes?
and work like Windows Explorer (allowing drag when selecting part of the row that is highlighted)
I suggest you to use VirtualTreeView instead. It is a powerful component with a huge possibilities, so you can do what you want event if the themes are not available

Delphi XE2 modern looking MainMenu

I am trying to modernize the look of our older Delphi 7 application now that we are using Delphi XE-2. I experimented with the TRibbon, and although I like it, it probably is not the correct solution since we currently use a TMainMenu and make many runtime changes to it - our users can modify the main menu. But the default Mainmenu looks old, especially compared to the image shown.
What I am trying to do is something very close to the attached image, especially with the background color, but I don't quite understand how this was done. Can anyone tell me if this example (the File/View/Insert section) uses a TMainMenu, or is it Buttons on a Toolbar ? If we require a customizable main menu, do you think the example shown is an option ?
This example image comes from DevExpress Print Sample library.
Edit : I am new here so I can't include the image. Here is the link :
http://www.devexpress.com/Products/VCL/ExPrintingSystem/gallery.xml
The second image, the green one that says "Print Preview".
You could use the TActionMainMenuBar but the simpler solution for you is to Use Vcl styles, pick a theme, modify the graphical properties of a MainMenu component and then use StyleHooks to force the style just for the MainMenu component without using it for the whole application.

Resources