中国开发网: 论坛: 程序员情感CBD: 贴子 28640
李颖: 你直接通过Windows API来显示/隐藏FORM,这样不好
因为Delphi包装的VCL组件,内部保留了成员变量来表示VISIBLE状态

你直接用Windows API来显示FORM

Window被显示出来了,但是FORM对象的VISIBLE属性仍然是FASLE

看下面的代码:

procedure TCustomForm.Hide;
begin
Visible := False;
end;

procedure TControl.SetVisible(Value: Boolean);
begin
if FVisible <> Value then
begin
VisibleChanging;
FVisible := Value;
Perform(CM_VISIBLECHANGED, Ord(Value), 0);
RequestAlign;
end;
end;

所以这个时候Hide方法没有作用,因为FVisible等于FALSE
DISSENT IS THE HIGHEST FORM OF PATRIOTISM !

--Thomas Jefferson

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录