Hi Al.
Um, I might be wrong, but by doing "with sender as TCheckListBox do" you 
are saying that the Sender "IS" a TCheckBox when it might not be, where 
as "if sender = Checklistbox3 then" is checking that it is a 
TCheckBox....if you get my meaning.

Jeremy

-----Original Message-----
From: Alistair George <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Tue, 26 Aug 2003 12:55:42 +1200
Subject: [DUG]:  Checklist box problem

> Hi all.
> I made some code (below) and it worked fine here but user reported the
> following:
> If I click on any option in the "Other Functions" zone (main screen),
> there are a lot of display
> "problems". These problems can vary from one time to the other.
> 
> example 1 : I click on any option in "Other Functions", then all the
> options in this zone and the
> other zones (right of the browser) disappear from the screen ! If I
> click on any other zone ("Add
> settings for example), the options (they had disappeared) re-appear (!)
> and it is the same for all
> the other zones who had disappeared (I have to click once and they
> "re-appear" : magic !) except
> for the "Other Functions" (the options never re-appear).
> 
> example 2 : I click on any option in "Other Functions", then all the
> options in this zone
> disappear and they never re-appear.
> 
> This was the original faulty code (designed to allow users to click on
> the caption, as
> well as the checkbox):
> 
> procedure TMainform.CheckListBox3Click(Sender: TObject);
> begin
> with sender as TCheckListBox do
> Checklistbox3.Checked[ItemIndex]:=not Checklistbox3.Checked[ItemIndex];
> end;
> 
> 
> this is the new which I have not tried with him, but also works OK
> here:
> procedure TMainform.CheckListBox3Click(Sender: TObject);
> begin
> if sender = Checklistbox3 then
> with sender as TCheckListBox do
> Checklistbox3.Checked[ItemIndex]:=not Checklistbox3.Checked[ItemIndex];
> end;
> 
> 
> Before doing the above click event the program had no problems.
> Any ideas?
> Tks Al+
> 
> -----------------------------------------------------------------------
> ----
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to