Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

Windows themed buttons and textboxes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows themed buttons and textboxes

    How do I cause my buttons and other controls to inherit the Windows Theme. I've got Firefly and I want to be able to create those types of controls but don't have a full understanding yet of just how they are created. All I know is to use CreateWindowEx with a registered class or create and register a class of my own. Is there a simple example of an SDK Window, and a small variety of controls. I'd like to get more control over the look and feel without having to rely on Firefly, although it's a super product for a new project, I have existing code that I don't want to have to completely rewrite.

    or

    Is it my best option to just study the generated code from Firefly or Phoenix Thunder?

    Thanks,

    Bob Mechler

  • #2
    AFAIK, if you use owner-drawn buttons and use only the system colors (GetSysColor, GetSysColorBrush) themes are automatcally inherited. Or maybe it's "Don't owner-draw at all."

    I'm pretty sure it's something like that, because when I did some owner-draw buttons and used my own colors only for some things - allowing the system to handle the rest - my buttons looked simply awful when run on a "themed" system.

    But that was a long time ago, so there might be some better way to handle it now.

    Easy enough to test: Write a 'nothing' screen with some "not owner drawn" buttons and text boxes etc, turn themes on and off on your system and see what happens.
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      There are two ways to make an existing application theme aware:
      • Create a manifest file named <MyApp>.exe.manifest, where Myapp is the name of your application, in the same directory where your application resides.
      • Create a manifest file and add it to the resource file used by your application.


      More information: http://www.jose.it-berater.org/smffo...php?topic=75.0
      Forum: http://www.jose.it-berater.org/smfforum/index.php

      Comment


      • #4
        The <MyApp>.exe.manifest worked right out of the box. With 300 hundred plus programs, I'll need to go on and add this to my resource file.
        Great information. Your site is an incredible resource.

        Many thanks,

        Bob Mechler

        Comment


        • #5
          I use FireFly too and have some of my apps with themes. A Resource is the best way to go. FireFly has an option in Code Generation too. I never use it, but I think it adds a resource too, and it makes FireFly display the Form how it will look with themes in the IDE. FireFly itself uses a manifest file since it is easy to delete and disable themes so the IDE doesn't show them.

          Keep in mind that you get some "extras" with themes too. Automatic Balloon tips on Password and Numeric Text boxes telling you if Caps is on or if non-numeric (This sometimes causes issues with Frame Controls painting and you have to play with the clip/drawing styles, Frame Controls actually color different too). You also get better Balloon Tooltips, if you use them, with more options. If your Checkbox/Radio Buttons have text that is colored it won't be colored. Statusbars paint different and panel size is off. Buttons are themed, but image buttons are not (Unless done manually, and I think Jose has some buttons on his page doing this too). And Tab Control colors are different. That and Tabs with images don't theme in transparent regions of image either...Probably could be done manually as with buttons, but right now FF doesn't do it.
          sigpic
          Mobile Solutions
          Sys Analyst and Development

          Comment

          Working...
          X