I have upgraded to Delphi XE from 2009 and am experiencing a strange issue.
I create a new project, put down a TRibbon control, compile and run. Keeping the form in its default size I then minimize and restore without issues. I then maximise the form, minimize and restore and the form colour is changed to black.
I have no random code to change it and am using all defaults Delphi XE comes with and it does it each and every time without fail.
I have moved the compiled exe to a friends computer and the problem remains so I know it's not my computer. If I turn off Aero effects the problem goes away, but put Aero back on and the problem returns.
Any ideas at all? I'm having trouble finding any relevant threads regarding this issue across the interwebs.
Thanks, Seb
Edit (as requested, the DFM for the Form that displays this behaviour. Note: This happens on any project I start):
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 555
ClientWidth = 989
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PrintScale = poNone
Scaled = False
PixelsPerInch = 96
TextHeight = 13
object Ribbon1: TRibbon
Left = 0
Top = 0
Width = 989
Height = 143
Caption = 'Ribbon1'
ExplicitLeft = 104
ExplicitTop = 296
ExplicitWidth = 0
StyleName = 'Ribbon - Luna'
end
end
Nothing fanciful at all, it's just a new project with a single form.
GlassFrame.SheetOfGlass = True
? Asking because Black is the default keying color for glass, maybe "glass" somehow gets disabled for your app and you end up with the black key color visible. – RoyalroyalistGlassFrame.SheetOfGlass
fixes it is a hint, the black you're seeing is truly related to "glass". Unfortunately I can't test right now. I'd follow several approaches: trace the code when I toggleSheetOfGlass
and see what API calls are involved, then figure out if some of those API's are called in the program for other reasons. Then I'll try to figure out if the Black is painted by the VCL or by Windows itself: I'd try overriding the form's WM_ERASEBKGND handler and paint the background red. – Royalroyalistif GlassFrameSupported then begin canvas.Brush.color := clBlack; canvas.FillRect(LRect); end
but changing it doesn't seem to do anything, even if I change clBlack to something else, perhaps I'm doing it wrong? (I change the code and save, not sure if that is correct). Thanks for your assist so far :) - It's suspicious to me, lol – VoracityFParentForm.GlassFrame.Enabled := True;
(line: 4687) when set toFalse
stops the form from turning black, however it also removes the system buttons (min, max and close), lol. One step forward, one step back. :) Thanks again will keep you posted on what I find. – VoracityGlassFrame
for your form, checkGlassFrame.Top/Bottom/Left/Right
, maybe somethings wrong with those, surfacing some bug. Try making them all 0 and see what happens. Posting the DFM for a minimal form that exhibits this would also be interesting, I'd like to try it myself. – RoyalroyalistGlassFrame.SheetOfGlass := False; GlassFrame.Enabled := False; GlassFrame.Top/Bottom/Left/Right := 0);
This is the default setting (as set by Delphi when you start a new project). Apart from throwing down a TRibbon, I've made no other changes. A friend who has Delphi XE tried it and is unable to duplicate the issue (I've tried to uninstall/reinstall but it made no difference, neither did a Repair). – Voracity