李颖:
你直接通过Windows API来显示/隐藏FORM,这样不好
[阅读: 718] 2004-09-29 07:54:57
因为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