Link to home
Create AccountLog in
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Avatar of VSmolensky
VSmolensky

Completely changing the color of a form
Hi,

In Delphi, changing the color of a form doesn't affect the colors of buttons on this form, as well as the color of its main menu. Is there any way to totally change the color of the form, with all its controls?

Vadim Smolensky,
Saint-Petersburg, Russia

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of DarkCore_DarkCore_

Directly I think not ... but you can do a cursor for all components ...

for i := 0 to ComponentCount - 1 do Begin
    Components[i].Color := FormColor;
End;

Avatar of esoftbgesoftbg🇧🇬

there is some buttons that have a property Color in the JEDI package of components (TJvImgBtn, TJvHTButton)
http://homepages.borland.com/jedi/jvcl/

Avatar of esoftbgesoftbg🇧🇬

about TJvHTButton, when the property ParentColor is True (it is as defalt True) the button gets the color from the parent Form

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Well there's a lot of problems with changing colors of components. Most are using winApi and their color cannot be changed. There is a way to do this but it will also change colors in all other apps. I was recently writing an app for a client who insisted to have all controls green. Some controls as buttons can be changed easily, but i was forced to write scrollbar component and use xp style mainmenu to fulfill client demands. One solution to make custom look for an app you can find here -> https://www.experts-exchange.com/questions/21184223/Defining-Classic-Windows-style-for-one-application.html i won't repeat myself the question was similiar...

Avatar of VSmolenskyVSmolensky

ASKER

Thank you all for your comments.

Unfortunately, Components[i].Color doesn't work, which is only natural because TComponent has no Color property. Either I didn't understand something or you meant something different.

I've downloaded the JEDI package of components but can't understand what to do next. It seems to be an independent software which I have to install and use it for generating all their components. It that right? Isn't there a way of just installing the component I need?

As Said by esoftbg ... you can't control the back color of  most of components located in "Standard" Palette, but you can do with TMenuItems ( defining the OnDrawItem Event )

Also, all other components that have the property "Color" , as an example:
  if Components[i] is TMemo then TMemo( Components[i] ).Color := clWhite;

TButtons doesn't have the TColor Property or the OnDraw event, because are "painted" directly by windows, also the TBitButton. Of course you can use TSpeedButtons, but then you can't focus them with keyboard.

jedi is a collection of components that install into your Delphi Palette and becomes integrated with Delphi and your applications ( if you use them ). Then you can use the Jedi replacement for TButton,but this implies You must replace your buttons for this Jedi's button in all your application.

Edu

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of esoftbgesoftbg🇧🇬

you have yet a directory:
....\JCL+JVCL210FullInstall
run from it:
Install.bat
and it will be apper:
Project JEDI Delphi Installer
Read carefully the check boxes to see what will be installed
Click on the button Install
and you will have JEDI - VCL Package installed

> you have yet a directory:
> ....\JCL+JVCL210FullInstall

Sorry, I haven't got a directory with such a name. Install.bat lies in the root directory called jvcl. When I run it, the installation started, but stopped at the step "Choose IDE targets" with the message "No JCL 1.9 found" - and it's still there, whatever directory I choose.

Avatar of esoftbgesoftbg🇧🇬

o.k. the direct link for JEDI package version 2.10 stable is:
http://belnet.dl.sourceforge.net/sourceforge/jvcl/JCL+JVCL210FullInstall.zip
download and unzip the file and you will have  directory ....\JCL+JVCL210FullInstall

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


I have already downloaded JVCL300BETA2Complete.zip - isn't it more or less the same?

Following the advice of phervers, I've downloaded the evaluation version of ThemeEngine. It seems to be a very powerful instrument. Would it be better to use ThemeEngine for making proper buttons than JEDI?

Avatar of esoftbgesoftbg🇧🇬

I am using vrsion 2.10, but it may be doesn't matter .... I hope it is a stable version ....
Just install it and from the tab Jv Additional you could be able to use the component TJvHTButton

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of esoftbgesoftbg🇧🇬

About the ThemeEngine I don't know .... I don't use it yet .... Sorry. You may try it.

Theme Engine is commercial product so you have to pay for it. But it can do a lot more than changing button color you can make a completely theme'able application, here's a small example what you can make using it   http://vteam.webpark.pl/cuemaker.rar . But if you only want to change color of your buttons JVCL should make it for you. Or if u don't want to use any external components you can use bitmap buttons.

I'm thingking about buying ThemeEngine but I have some difficulties with its evaluation verion (for Delphi 6). After the installation, all its components are available in the palette, but applications with them don't run. The compiler says "File not found: te_engine.dcu". Though all the .dcu files lie in the directory ...Delphi6\themeengine and finding then shouldn't be a problem. Should I configure anything else? I couln't find the answer in the attached documents.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Well, try to add Delphi6\themeengine into your library path, in Menu Tools\Environment Options .. tab Library.

Edu

Avatar of HypoviaxHypoviax🇦🇺

I am probably misunderstanding this but isn't there a property value called parentcolor?

IF this is set to true then the component adopts the color of the form otherwise it maintains its set colour.

Regards,

Hypoviax

Avatar of HypoviaxHypoviax🇦🇺

The jvhtbutton allows this parentcolor property value (jvAdditional) unlike normal buttons

Regards,

Hypoviax

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of esoftbgesoftbg🇧🇬

I tested TJvHTButton, when the property ParentColor is True with the Form that contains a Panel:
  Color of the form is clBtnFace - when I drop a JvHTButton on the Form it's color is clBtnFace;
  Color of the Panel is clMaroon - when I drop a JvHTButton on the Panel it's color is clMaroon;
  Then I did change the color of the Form to clBlue - the color of the JvHTButton which Parent is Form becomes clBlue, but other JvHTButton which Parent is Panel is still clMaroon as it's Parent color ....

So, JvHTButton gets the color from it's parent Component (Form, Panel, GroupBox ....)

Avatar of HypoviaxHypoviax🇦🇺

So i am right am i not?

Regards,

Hypoviax

Avatar of HypoviaxHypoviax🇦🇺

Sorry, i didn't read all your previous posts, my comments are what you, esoftbg were saying ;).

Oh well, it just confirms your post

Hypoviax

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of pherversphervers

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Thank you, everybody, and sorry for my disappearance. I've purchased ThemeEngine. In many aspects it looks very impressive but still not free from some shortcomings. For example, the menu bar component they provide doesn't support radio items. The Theme Editor seems to be a powerful instrument but the help system is designed rather poorly and it's really difficult to understand how to use all its features. Is there any experts here who is an experienced user of ThemeEngine and especially of Theme Editor? Is there any material to read about it? Any discussions? The newsgroups on Theme Engine page are announced but closed.

V.S.
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.