Article View: borland.public.cppbuilder.nativeapi
Article #16305Re: Prevent a user from checking a TListItem
From: Remy Lebeau (TeamB)
Date: Tue, 20 May 2003 22:14
Date: Tue, 20 May 2003 22:14
26 lines
1823 bytes
1823 bytes
"StarCinema - Rodolfo Frino" <starcinema@stargate.com> wrote in message
news:3eca9e2e@newsgroups.borland.com...
> void __fastcall TForm1::ListView1Change(TObject *Sender, TListItem *Item,
> TItemChange Change)
> {
> Item->Checked = false;
> }
If you're going to do that, then at least test the Change parameter first so
that you're not invoking the overhead of accessing the ListItem unless you
really need to:
void __fastcall TForm1::ListView1Change(TObject *Sender, TListItem
*Item, TItemChange Change)
{
if( (Item) && (Change == ctState) )
Item->Checked = false;
}
Just keep in mind that the event is only triggered when the Item's Selected,
Focused, or Cut properties are changed.
Gambit
Technical Details
Message-ID:
<3ecaa84b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3eca8580@newsgroups.borland.com> <3eca8cff@newsgroups.borland.com> <3eca928b$1@newsgroups.borland.com> <3eca9e2e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,a81cc7d506c46104 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-20 15:47:33 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3eca8580@newsgroups.borland.com> <3eca8cff@newsgroups.borland.com> <3eca928b$1@newsgroups.borland.com> <3eca9e2e@newsgroups.borland.com> Subject: Re: Prevent a user from checking a TListItem Date: Tue, 20 May 2003 15:14:51 -0700 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3ecaa84b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1053468747 207.175.226.26 (20 May 2003 15:12:27 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail