Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   how do i remove white background in node inside virtual TVirtualStringTree? (https://www.delphipraxis.net/188769-how-do-i-remove-white-background-node-inside-virtual-tvirtualstringtree.html)

drama22 6. Apr 2016 00:31

how do i remove white background in node inside virtual TVirtualStringTree?
 
i tried to use TargetCanvas.Brush.Style := bsClear; inside BeforeCellPaint still node have white back ground here is the full code

Delphi-Quellcode:
procedure TForm2.VTs1BeforeCellPaint(Sender: TBaseVirtualTree;
  TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
  CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
begin
TargetCanvas.Brush.Style := bsClear;
TargetCanvas.FillRect(CellRect);
end;

Zacherl 6. Apr 2016 11:08

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
What exactly are you trying to do?

You can set a custom color for each row like this:
Delphi-Quellcode:
procedure TfrmMain.EditorTreeBeforeItemErase(Sender: TBaseVirtualTree; TargetCanvas: TCanvas;
  Node: PVirtualNode; ItemRect: TRect; var ItemColor: TColor; var EraseAction: TItemEraseAction);
begin
  EraseAction := eaColor;
  ItemColor := clBlue;
end;
If you like to use colored rows while using a background image, try this:
http://stackoverflow.com/a/10537589

drama22 6. Apr 2016 13:32

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
Zitat:

Zitat von Zacherl (Beitrag 1334785)
What exactly are you trying to do?

i dont want any back ground around the cell just the text

Zacherl 6. Apr 2016 13:57

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
So you want to make the cell transparent? I don't think that's possible at all :/ There might be a hacky way by manually drawing the contents of the parent canvas before printing the text, but I never saw something like that in action.

drama22 6. Apr 2016 14:17

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
Zitat:

Zitat von Zacherl (Beitrag 1334807)
So you want to make the cell transparent? I don't think that's possible at all :/ There might be a hacky way by manually drawing the contents of the parent canvas before printing the text, but I never saw something like that in action.

i think there is way because i found something like that in action

Zacherl 6. Apr 2016 14:50

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
Zitat:

Zitat von drama22 (Beitrag 1334809)
i found something like that in action see this image

I can't even see the actual VirtualStringTree control on this picture :pale: Is it the gradient thingy in the background?

drama22 6. Apr 2016 15:03

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:

Zitat von Zacherl (Beitrag 1334811)

I can't even see the actual VirtualStringTree control on this picture :pale: Is it the gradient thingy in the background?

this gradient can be drawn easy on paint-background as eg .
Delphi-Quellcode:
procedure TForm2.VTs1PaintBackground(Sender: TBaseVirtualTree;
  TargetCanvas: TCanvas; R: TRect; var Handled: Boolean);
begin
 //
  GradientFillCanvas(TargetCanvas, clred, clWhite, R, gdHorizontal); // GraphUtil
  Handled := True;

end;
the white bg of node is the issue see my example

uligerhardt 6. Apr 2016 15:14

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
Zitat:

Zitat von drama22 (Beitrag 1334809)

Please use the attachment feature of this forum for pictures. File hosters are blocked at my workplace (and that of others too, I guess).

drama22 6. Apr 2016 22:19

AW: how do i remove white background in node inside virtual TVirtualStringTree?
 
Zitat:

Zitat von uligerhardt (Beitrag 1334814)
Please use the attachment feature of this forum for pictures. File hosters are blocked at my workplace (and that of others too, I guess).

image attached .


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz