4

In my application, i've created a signup form and i need to show an Error Icon whenever an Edit is empty or contain some error. But the image haven't a Name property and therefor i am unable to to call the Hide the image by its name. Therefore i decided to put an image into the panel and hide the panel instead. something like :

    if(lenght(edit1.text)=0) then
       Panel1.show else Panel1.hide;  // this code shows or hide the image

The problem is that the panel's border still appear after setting BorderStyle to bsNone.

How to hide completely the panel's border ?

menjaraz
  • 7,551
  • 4
  • 41
  • 81
Rafik Bari
  • 4,867
  • 18
  • 73
  • 123
  • 2
    How do you display the image? If it is a TImage that is placed on the form then it will have a name. If you create it from code then just keep a reference to it. – Ville Krumlinde Jan 05 '12 at 17:55
  • 3
    What's preventing you from simply *giving* the image component a name? It's *your* program, so if there's something about it that makes your task difficult, you can fix it. – Rob Kennedy Jan 05 '12 at 18:25

2 Answers2

18

(Your actual problem most likely can be solved without adding a TPanel, but I still answer your actual question here.)

Set BevelInner and BevelOuter to bvNone.

By the way, your code can be written more elegantly as

Panel1.Visible := Length(Edit1.Text) = 0;
Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
0

I set following properties which worked for me in situation like you have

BevelInner := bvNone;
BevelOuter := bvNone;
BevelKind := bkNone;