[DUG] Enable CheckBox

Kyley Harris Kyley at harrissoftware.com
Tue Apr 27 12:05:36 NZST 2010


Bob.. Are you saying that Empty space is also considered no data?

in that case..

Control.Enabled := Trim(Text) <> '';

is likely what you want to test for.

On Tue, Apr 27, 2010 at 10:39 AM, Bob Pawley <rjpawley at shaw.ca> wrote:

>  Hi
>
> I am attempting to enable a checkbox only when a DBEdit has a value.
> (Disabled when no string in DBEdit.)
>
> Following is my code which disables the CheckBox after a delete from the
> DBEdit.
>
> But it is not enabled when I add a string to the DBEdit.
> ------
> procedure TForm4.DBEdit2Change(Sender: TObject);
> begin
>
>      if
>   DBEdit2.Text = ' '
>
>   then
>   DBCheckBox4.Enabled := True
>
>   Else if DBEdit2.Text = ''''
>
>   then
>    DBCheckBox4.Enabled := False ;
>
> end;
>
> Thanks for any help.
>
> Bob
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>



-- 
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100427/9dca9dd1/attachment.html 


More information about the Delphi mailing list