Good Afternoon,
If i place a TAdvShape in a TScrollBox with a DoubleBuffered property Set to True the Shape is not displayed.
With DoubleBuffeed set to false all works fine
thank you
L.
I have retested this here with following form file but I could not see any issue:
The problem occurs when you try to create objects at runtime.
I think is a refresh problem (with original TShape all works fine)
My Form:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 411
ClientWidth = 852
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ScrollBox1: TScrollBox
Left = 184
Top = 24
Width = 305
Height = 289
VertScrollBar.Smooth = True
VertScrollBar.Style = ssFlat
VertScrollBar.Tracking = True
DoubleBuffered = False
ParentDoubleBuffered = False
TabOrder = 0
end
object Button1: TButton
Left = 8
Top = 8
Width = 113
Height = 25
Caption = 'Create at Runtime'
TabOrder = 1
OnClick = Button1Click
end
end
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
My Code:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvShape, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm1 = class(TForm)
ScrollBox1: TScrollBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var vShape: TAdvShape;
vPanel: TPanel;
vOriShape: TShape;
begin
ScrollBox1.DoubleBuffered := True;
vPanel := TPanel.Create(ScrollBox1);
vPanel.Parent := ScrollBox1;
vPanel.Height := 100;
vPanel.Align := alTop;
vOriShape := TShape.Create(ScrollBox1);
vOriShape.Top := vPanel.Height+1;
vOriShape.Align := alTop;
vOriShape.Parent := ScrollBox1;
vShape := TAdvShape.Create(ScrollBox1);
vShape.Top := vOriShape.Top+vOriShape.Height+1;
vShape.Align := alTop;
vShape.Parent := ScrollBox1;
end;
end.
To solve this, please set AdvShape.Clipping := false
mmmm yes. The Shape is showed but I lost the transparency