[Lazarus] Subroutine ?

Frederic Da Vitoria davitofrg at gmail.com
Wed Jul 31 14:47:44 CEST 2013


2013/7/31 Terry A. Haimann <terry at haimann.us>

> 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
>

Hmm, I am still unsure, are you really speaking of components (in which
case you may want to do things like connect conditionally) or of controls
(you want only to prevent the user from interacting with the form)?

-- 
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130731/4b6e078d/attachment-0003.html>


More information about the Lazarus mailing list