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.
I am able to reproduce the bug, here are some of the issues I discovered. Maybe they'll help someone figure this thing out.
Invalidate
from the button's OnClick
event, the form gets it's colors back.WndProc
on WM_SIZE
with wParam
= SIZE_MAXIMIZED
, then call Invalidate
from the timer the form gets it's colors back. This is essentially the same as the first method (calling Invalidate
from a button), but the timer makes this automatic and ensures Invalidate
is called only when there are no more messages to be processed. I tried the same with a simple PostMessage
but didn't work (ie: I was probably Invalidate
-ing too soon, and that's probably an other clue)Application.MainFormOnTaskbar := False
in the project's source, I no longer see the black form.The ribbon takes up the top part of the form. Place a TPanel
on the rest of the form, make it Align = alClient
and put everything on the Panel. The Black behind the panel is no longer visible!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With