4

在我的应用程序中,我创建了一个注册表单,每当编辑为空或包含一些错误时,我都需要显示一个错误图标。但是该图像没有 Name 属性,因此我无法通过其名称调用隐藏图像。因此,我决定将图像放入面板并隐藏面板。就像是 :

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

问题是在将BorderStyle设置为bsNone后,面板的边框仍然出现。

如何完全隐藏面板的边框?

4

2 回答 2

17

(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;
于 2012-01-05T17:54:11.617 回答
0

我设置了以下在您遇到的情况下对我有用的属性

BevelInner := bvNone;
BevelOuter := bvNone;
BevelKind := bkNone;
于 2020-09-04T05:04:20.093 回答