<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:x = 
"urn:schemas-microsoft-com:office:excel" xmlns:p = 
"urn:schemas-microsoft-com:office:powerpoint" xmlns:a = 
"urn:schemas-microsoft-com:office:access" xmlns:dt = 
"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s = 
"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs = 
"urn:schemas-microsoft-com:rowset" xmlns:z = "#RowsetSchema" xmlns:b = 
"urn:schemas-microsoft-com:office:publisher" xmlns:ss = 
"urn:schemas-microsoft-com:office:spreadsheet" xmlns:c = 
"urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc = 
"urn:schemas-microsoft-com:office:odc" xmlns:oa = 
"urn:schemas-microsoft-com:office:activation" xmlns:html = 
"http://www.w3.org/TR/REC-html40" xmlns:q = 
"http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc = 
"http://microsoft.com/officenet/conferencing" XMLNS:D = "DAV:" XMLNS:Repl = 
"http://schemas.microsoft.com/repl/" xmlns:mt = 
"http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2 = 
"http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda = 
"http://www.passport.com/NameSpace.xsd" xmlns:ois = 
"http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir = 
"http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds = 
"http://www.w3.org/2000/09/xmldsig#" xmlns:dsp = 
"http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc = 
"http://schemas.microsoft.com/data/udc" xmlns:xsd = 
"http://www.w3.org/2001/XMLSchema" xmlns:sub = 
"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec = 
"http://www.w3.org/2001/04/xmlenc#" xmlns:sp = 
"http://schemas.microsoft.com/sharepoint/" xmlns:sps = 
"http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi = 
"http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs = 
"http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf = 
"http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p = 
"http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf = 
"http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss = 
"http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi = 
"http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi = 
"http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver = 
"http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels = 
"http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp = 
"http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t = 
"http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m = 
"http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl = 
"http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl = 
"http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" 
XMLNS:Z = "urn:schemas-microsoft-com:" xmlns:st = ""><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904">
<STYLE>@font-face {
        font-family: Cambria Math;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt
}
LI.MsoNormal {
        MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt
}
DIV.MsoNormal {
        MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"; FONT-SIZE: 12pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal-reply
}
..MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-NZ link=blue bgColor=white vLink=purple>
<DIV><FONT color=#000000 size=2 face=Arial>A couple of thoughts on 
this:</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>1 - If you want to test its empty it 
may be more general to go</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">DBCheckBox4.Enabled 
:= not (trim(DBEdit2.Text) = '') ;</SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"></SPAN>&nbsp;</P>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">I think as it is it 
should be OK in this case if the underlying data for DBEdit2 is null, but you 
may want to check that as well, as a null value can stuff up tests like this 
sometimes.</SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"></SPAN>&nbsp;</P>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">2 - A non-initialised 
DBCheckBox4 can behave a little oddly - it may show as looking disabled simply 
because the value of DBCheckBox4.checked is seen as neither true nor 
false.&nbsp; This can happen in D5, not sure about later versions.&nbsp;&nbsp; 
You may need to initialise it specifically, and check the AllowGrayed property 
as well.</SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt"><FONT color=#1f497d 
face=Calibri></FONT></SPAN>&nbsp;</P></FONT></DIV>
<DIV>John Bird<BR>JBCL<BR>Contact:<BR><A 
href="mailto:johnkbird@paradise.net.nz">johnkbird@paradise.net.nz</A><BR><A 
href="mailto:jbclnz@xtra.co.nz">jbclnz@xtra.co.nz</A><BR>027 4844528<BR><A 
href="http://jbclnz.googlepages.com">http://jbclnz.googlepages.com</A><BR><A 
href="http://www.jbcl.co.nz">http://www.jbcl.co.nz</A></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=Dave@iccs.co.nz href="mailto:Dave@iccs.co.nz">David O'Brien</A> 
</DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@delphi.org.nz 
  href="mailto:delphi@delphi.org.nz">NZ Borland Developers Group - Delphi 
  List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, April 27, 2010 10:52 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [DUG] Enable CheckBox</DIV>
  <DIV><FONT color=#000000 size=2 face=Arial></FONT><BR></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">Why 
  the four quotes in the false and a space in the true?<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p>&nbsp;</o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt">I 
  would use something like:<o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p>&nbsp;</o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">DBCheckBox4.Enabled 
  := not (DBEdit2.Text = '') ;</SPAN><SPAN 
  style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"><o:p>&nbsp;</o:p></SPAN></P>
  <DIV>
  <DIV 
  style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
  <P class=MsoNormal><B><SPAN 
  style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt" 
  lang=EN-US>From:</SPAN></B><SPAN 
  style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt" lang=EN-US> <A 
  href="mailto:delphi-bounces@delphi.org.nz">delphi-bounces@delphi.org.nz</A> 
  [mailto:delphi-bounces@delphi.org.nz] <B>On Behalf Of </B>Bob 
  Pawley<BR><B>Sent:</B> Tuesday, 27 April 2010 10:39 a.m.<BR><B>To:</B> NZ 
  Borland Developers Group - Delphi List<BR><B>Subject:</B> [DUG] Enable 
  CheckBox<o:p></o:p></SPAN></P></DIV></DIV>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Hi</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">I am attempting to 
  enable a checkbox only when a DBEdit has a value. (Disabled when&nbsp;no 
  string in DBEdit.)</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Following is my 
  code which disables the CheckBox after a delete from the 
  DBEdit.</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">But it is not 
  enabled when I add a string to the DBEdit.</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">------</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">procedure 
  TForm4.DBEdit2Change(Sender: TObject);<BR>begin</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp; 
  if<BR>&nbsp; DBEdit2.Text = ' '</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">&nbsp; 
  then<BR>&nbsp; DBCheckBox4.Enabled := True</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">&nbsp; Else if 
  DBEdit2.Text = ''''</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">&nbsp; 
  then<BR>&nbsp;&nbsp; DBCheckBox4.Enabled := False 
;</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">end;</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Thanks for any 
  help.</SPAN><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><SPAN 
  style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Bob</SPAN><o:p></o:p></P></DIV></DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>NZ Borland 
  Developers Group - Delphi mailing list<BR>Post: delphi@delphi.org.nz<BR>Admin: 
  http://delphi.org.nz/mailman/listinfo/delphi<BR>Unsubscribe: send an email to 
  delphi-request@delphi.org.nz with Subject: 
unsubscribe</BLOCKQUOTE></BODY></HTML>