Bob.. Are you saying that Empty space is also considered no data?<div><br></div><div>in that case..</div><div><br></div><div>Control.Enabled := Trim(Text) <> ''; </div><div><br></div><div>is likely what you want to test for.<br>
<br><div class="gmail_quote">On Tue, Apr 27, 2010 at 10:39 AM, Bob Pawley <span dir="ltr"><<a href="mailto:rjpawley@shaw.ca">rjpawley@shaw.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hi</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">I am attempting to enable a checkbox only when a
DBEdit has a value. (Disabled when no string in DBEdit.)</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Following is my code which disables the CheckBox
after a delete from the DBEdit.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">But it is not enabled when I add a string to the
DBEdit.</font></div>
<div><font size="2" face="Arial">------</font></div>
<div><font size="2" face="Arial">procedure TForm4.DBEdit2Change(Sender:
TObject);<br>begin</font></div>
<div> </div>
<div><font size="2" face="Arial"> if<br> DBEdit2.Text
= ' '</font></div>
<div> </div>
<div><font size="2" face="Arial"> then<br> DBCheckBox4.Enabled :=
True</font></div>
<div> </div>
<div><font size="2" face="Arial"> Else if DBEdit2.Text = ''''</font></div>
<div> </div>
<div><font size="2" face="Arial"> then<br> DBCheckBox4.Enabled :=
False ;</font></div>
<div> </div>
<div><font size="2" face="Arial">end;</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Thanks for any help.</font></div>
<div><font size="2" face="Arial"></font> </div><font color="#888888">
<div><font size="2" face="Arial">Bob</font></div></font></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br><br clear="all"><br>-- <br>Kyley Harris<br>Harris Software<br>
+64-21-671-821<br>
</div>