Error when DBGrid.setfocus lazarus / 16-Databases ---------------------------------------------------------------------- qiaoqia6448 · 2011-03-25 14:34 I cant setfocus on DBGrid  , the command is : case D of       DBTVtype:  SQL:='EXEC _GetVtypeList '''+K+''','''+idstr+'''';       DBTVIP:     SQL:='EXEC _GetVIPList '''+K+'''';     end;     dmd.OpenSQL(SQL,RD);     if RD.RecordCount=0 then LE.SetFocus    //如果没有结果,则等待用户查询     else if RD.RecordCount=1 then OKButtonClick(nil)     else begin          dbgrid1.SetFocus;     end ;                     and the debuger bring to next code: procedure TCustomForm.SetFocus;   procedure RaiseCannotFocus;   var     s: String;   begin     s:='[TCustomForm.SetFocus] '+Name+':'+ClassName+' '+rsCanNotFocus;     {$IFDEF VerboseFocus}     RaiseGDBException(s);     {$ELSE}     raise EInvalidOperation.Create(s);     {$ENDIF}   end;                   why?  the DBGrid can't setFocus? please help me ---------------------------------------------------------------------- qiaoqia6448 · 2011-03-25 14:50 I find the problem ,because I had not shown the form. edit Changed fontsize, no need to scream