Board index » delphi » TPanel with Brush.Style = bsClear doesn't work

TPanel with Brush.Style = bsClear doesn't work

In the Delphi formeditor, if you move or resize an object, you see an
white rectangular. We want to do that in out application also. We thought
to use a TPanel object. We set the Brush.Style to bsClear and we hoped to
see only the outline of panel which we can move around the parent window.
BUT it didn't work. What are we doing wrong? Or does somebody know a
better method to do this task.

Some help highly appriciated,

Jaap Mosselman

J.Mossel...@pr.agro.nl

 

Re:TPanel with Brush.Style = bsClear doesn't work


Draw the outline of the object with XOR line style, when
coordinate changes, XOR old outline again (it'll restore
previous screen appearence) and, again, draw new outline
with a XOR style; and so on... You'll need to draw on
the Form's canvas.

Dmitry

In article <31532DEE....@PR.AGRO.NL>,
   "J. Mosselman" <J.Mossel...@PR.AGRO.NL> wrote:

Quote
>In the Delphi formeditor, if you move or resize an object, you see an
>white rectangular. We want to do that in out application also. We thought
>to use a TPanel object. We set the Brush.Style to bsClear and we hoped to
>see only the outline of panel which we can move around the parent window.
>BUT it didn't work. What are we doing wrong? Or does somebody know a
>better method to do this task.

>Some help highly appriciated,

>Jaap Mosselman

>J.Mossel...@pr.agro.nl

Re:TPanel with Brush.Style = bsClear doesn't work


Quote
"J. Mosselman" <J.Mossel...@PR.AGRO.NL> wrote:
>In the Delphi formeditor, if you move or resize an object, you see an
>white rectangular. We want to do that in out application also. We thought
>to use a TPanel object. We set the Brush.Style to bsClear

        What Brush.Style are you talking about exactly? A Canvas has a
brush, but a panel does not have a Canvas.

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Re:TPanel with Brush.Style = bsClear doesn't work


Quote
>   David Ullrich <ullr...@math.okstate.edu> writes:
>  "J. Mosselman" <J.Mossel...@PR.AGRO.NL> wrote:
>  >In the Delphi formeditor, if you move or resize an object, you see an
>  >white rectangular. We want to do that in out application also. We thought
>  >to use a TPanel object. We set the Brush.Style to bsClear

>    What Brush.Style are you talking about exactly? A Canvas has a
>  brush, but a panel does not have a Canvas.

It does have a Canvas.  You just have to redeclare it as public or publish.

{...}
type
  TPanelC = class(TPanel)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    property Canvas;
  published
    { Published declarations }
  end;
{...}

Now you can change the Panelc1.Canvas.Pen.style to psClear and you will not see any borders!
You can do the same with the Brush.

Re:TPanel with Brush.Style = bsClear doesn't work


Quote
>>  brush, but a panel does not have a Canvas.

>It does have a Canvas.  You just have to redeclare it as public or publish.

        Lemme write this down... thanks.

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Other Threads