[Lazarus] Subroutine ?

Terry A. Haimann terry at haimann.us
Wed Jul 31 14:23:02 CEST 2013


Interesting and I didn't know you could do that.  But, more of what I
have in mind is.

I have a bunch of database components on a form, I want them to be
enabled only after hitting the edit or insert button on the DbNavigator.
Since this is going to occur in multiple points in my button procedure,
it would be programmatically better if this could be done in a sub
procedure.  Also, I have fields that are dependent on other fields, so
fieldsz only would become active if fieldx has a 'Y' in it. 

On Wed, 2013-07-31 at 07:45 +0200, Mattias Gaertner wrote:
> On Tue, 30 Jul 2013 22:53:40 -0500
> "Terry A. Haimann" <terry at haimann.us> wrote:
> 
> > I am sure this is a dumb ?, but I want a subroutine that will change all
> > of the components of a form to Enabled := False.
> > 
> > How do I do this?
> 
> for i:=0 to ControlCount-1 do
>   Controls[i].Enabled:=false;
> 
> Mattias
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus






More information about the Lazarus mailing list