Solved

Completely changing the color of a form

Posted on 2004-10-27
782 Views
Last Modified: 2012-08-14
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
0
Question by:VSmolensky
    23 Comments
     
    LVL 2

    Expert Comment

    by: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;
    0
     
    LVL 12

    Expert Comment

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

    Expert Comment

    by:esoftbg
    about TJvHTButton, when the property ParentColor is True (it is as defalt True) the button gets the color from the parent Form
    0
     
    LVL 1

    Expert Comment

    by:phervers
    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 -> http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21184223.html i won't repeat myself the question was similiar...
    0
     

    Author Comment

    by:VSmolensky
    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?
    0
     
    LVL 2

    Expert Comment

    by:DarkCore_
    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
    0
     
    LVL 12

    Expert Comment

    by:esoftbg
    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
    0
     

    Author Comment

    by:VSmolensky
    > 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.
    0
     
    LVL 12

    Expert Comment

    by:esoftbg
    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
    0
     

    Author Comment

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

    Author Comment

    by:VSmolensky
    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?
    0
     
    LVL 12

    Expert Comment

    by:esoftbg
    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
    0
     
    LVL 12

    Expert Comment

    by:esoftbg
    About the ThemeEngine I don't know .... I don't use it yet .... Sorry. You may try it.
    0
     
    LVL 1

    Expert Comment

    by:phervers
    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.
    0
     

    Author Comment

    by:VSmolensky
    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.
    0
     
    LVL 2

    Expert Comment

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

    Edu
    0
     
    LVL 5

    Expert Comment

    by:Hypoviax
    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
    0
     
    LVL 5

    Expert Comment

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

    Regards,

    Hypoviax
    0
     
    LVL 12

    Expert Comment

    by:esoftbg
    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 ....)
    0
     
    LVL 5

    Expert Comment

    by:Hypoviax
    So i am right am i not?

    Regards,

    Hypoviax
    0
     
    LVL 5

    Expert Comment

    by:Hypoviax
    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
    0
     
    LVL 1

    Accepted Solution

    by:
    About ThemeEngine.  Installation should be enough, but if it doesn't work, try adding directory containing needed .dcu files to library path (in Delphi 7) menu Tools->Environment Options->Library->Library Path.

    About ParentColor you are right esoftbg button takes color from it's parent so it won't inherit form color if it's inside a panel, oe thing you can do to accomplish this is setting Panel's ParentColor:= True;
    0
     

    Author Comment

    by:VSmolensky
    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.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    845 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now