Very strange thing happening:
I had a whole bunch of TFrame's (might have been TCustomFrame, don't remember because I made an intermediate class between the 40 odd frames and the parent) that I was inheriting to make up the configuration part of a 'really cool' HL7 formula editor. What was weird, but not to the point, was that the DFM on the frame kept on adding OldCreateOrder, PixelsPerInch and TextHeight to the DFM, even though I never implemented those properties in the base class.
Anyway, I had to put those properties in my subclass even though I didn't want to, or else it wouldn't let me compile, so fine. Then I added one of those Color Chooser controls to one of my frames, and that worked until last week when it started giving me the business about not being able to find the parent.
So... I got rid of all my DFM's I changed all the Frames to Panels and it works fine (on my computer, running XP in VM with no themes), but for my colleague to the left of me (running Windows 7 natively) it doesn't matter what I do with TSpeedButtons on these Panels, they always have the same Sans 10pt Bold font, which would work, but I've got some weird symbols for set operations which I'd like to retain and CalcTextWidth totally fails.
I've tried:
ParentFont := true and false;
Flat := true and false;
Parent.Font := Whatever;
Suffice it to say, I've tried all the old tricks. The only thing that works is just removing the XP Manifest (did I mention this is Delphi 7). And that's not an option because sometime this year we're going to port everything over to D2009 and that... won't be an option!
Edit
The really strange thing is that using TFrame and a DFM, it works (even with an ancient compiler). Using TPanel it doesn't work.
There must be some difference between themes on a TPanel (or TCustomPanel, neither worked) and themes on a TFrame.
Also, I've got a TGroupBox between the buttons and the TPanel. Maybe that's causing the problem. I could change that pretty easy.
Edit 2
uses buttons, extctrls, stdctrls
(for Delphi 7, put XPManifest on your form)
procedure TForm1.FormCreate(Sender: TObject);
var
Panel : TPanel;
Grp : TGroupBox;
Btn : TSpeedButton;
begin
Panel := TPanel.Create(Self);
Panel.Parent := self;
Panel.Align := alClient;
Grp := TGroupBox.Create(Panel);
Grp.Parent := Panel;
Grp.Align := alClient;
Btn := TSpeedButton.Create(Grp);
Btn.Parent := Grp;
Btn.Width := 117;
Btn.Font.Name := 'Symbol';
Btn.Caption := 'Here is some text';
end;
In windows XP fine, tried on 2008 Server R2 and just shows bold sans font.
I tried this without the Group Box in between and it seems to work though.
(doing it with the frame works, but is too much code to post)