S
shephard
Unregistered / Unconfirmed
GUEST, unregistred user!
frm_quanxian打开frm_ygselect,在按了frm_ygselect上一按钮后关闭frm_ygselect,
并且使frm_quanxian上的dbedit1获得焦点,为什么会出现“cannot focus a disabled
or invisible windows!“,(dbedit1的ENABLED肯定是TRUE)
代码如下:
procedure Tfrm_main.N26Click(Sender: TObject);
begin
frm_quanxian:=Tfrm_quanxian.Create(Application) ;
runform(Tfrm_quanxian);
end;
function RunForm(TForm:TFormClass):Integer;
begin
with TForm.Create(Application) do
begin
ShowModal;
Free;
end;
end;
procedure Tfrm_ygselect.BitBtn1Click(Sender: TObject);
begin
close;
frm_quanxian.dbedit1.SetFocus ;
end;
并且使frm_quanxian上的dbedit1获得焦点,为什么会出现“cannot focus a disabled
or invisible windows!“,(dbedit1的ENABLED肯定是TRUE)
代码如下:
procedure Tfrm_main.N26Click(Sender: TObject);
begin
frm_quanxian:=Tfrm_quanxian.Create(Application) ;
runform(Tfrm_quanxian);
end;
function RunForm(TForm:TFormClass):Integer;
begin
with TForm.Create(Application) do
begin
ShowModal;
Free;
end;
end;
procedure Tfrm_ygselect.BitBtn1Click(Sender: TObject);
begin
close;
frm_quanxian.dbedit1.SetFocus ;
end;