| To: | REALbasic NUG Italian <realbasic-nug.it@lists.realsoftware.com> |
|---|---|
| Subject: | Re: Listbox colorazione riga subordinata a contenuto cella |
| From: | Massimo Lista <massimo.lista@gmail.com> |
| Date: | Tue, 16 Jun 2009 20:52:13 +0200 |
| Authentication-results: | mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug.it-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug.it-bounces@lists.realsoftware.com; dkim=neutral (body hash did not verify) header.i=@gmail.com |
| Delivered-to: | listarchive@realsoftware.com |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Zd0eYyjkoDVB7Ltbe2DEprH3mcu0ImuRK9U1gUGpGFE=; b=uG2DnVa0F618qjZnTeRydcA2me8NpfjHTovwLIl6F+UWs87HyIkPUfOM5EVZGLDzC8 H6Gf74yuAt4oD1/aA3ec/kF54pizrhPzwGiTMy/UpWWgZ5KJQgrTo+N7rInv2QJiki03 5lj43L79SSyGs94HoAmHZPegPzqJGUEDSa5jY= |
| Domainkey-signature: | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=sadCOvTFe8bhC4jjRrewRNAEHtx6hW6fK0KlNKOecpQQPgpzGilGgse80fQJ5zdLm6 CaLLcJ7Pstu1IvgQZHyhVEa8jyWhY7kQrkqSu/MEgO55Ez5oT3HfynDTsRZojVOkwLBR OdIbLHeB1enYwIVmcy8tzRAfWKlV+c7CQXBwQ= |
| In-reply-to: | <D34890EC-EACE-4373-B7A4-B036E66FED8F@yahoo.it> |
| References: | <26d1d61d0906160005g5bb14543lcd237730624eb81b@mail.gmail.com> <D34890EC-EACE-4373-B7A4-B036E66FED8F@yahoo.it> |
| Reply-to: | REALbasic NUG Italian <realbasic-nug.it@lists.realsoftware.com> |
| Sender: | realbasic-nug.it-bounces@lists.realsoftware.com |
OK Massimo. Grazie io ciclavo inutilmente. Il giorno 16 giugno 2009 12.37, Massimo Valle <maxduepuntozero@yahoo.it> ha scritto: > > Il ciclo for...next è inutile perchè l'evento viene innescato > automaticamente per OGNI cella in fase di ridisegno. Anche per quelle vuote. > > Quindi, è necessario prima di tutto assicurarsi che si stia operando su una > cella che contiene qualcosa: > > if row < me.listcount then > > e quindi verificare che la cella sia quella giusta: > > If me.Cell(row, 1) = "Pippo" then > > ma la cosa migliore a questo punto, per questioni di ottimizzazione sarebbe > fare ancora un controllo se siamo sulla colonna giusta, onde evitare di > effettuare il controllo di "Pippo" per ogni colonna. Quindi io sostituirei > il tutto così: > > if row < me.listcount then > if column = 1 then > If me.Cell(row, 1) = "Pippo" then > g.ForeColor=RGB(255,176,98) //Arancio > g.FillRect(0,0,g.Width,g.Height) > end if > end if > end if > > > Massimo Valle > > > On 16/giu/09, at 09:05, Massimo Lista wrote: > > Per colorare una riga subordinata al valore contenuto in una cella avevo >> scritto:Su Evento: CellBackgroundPaint >> >> Dim i, TotRow, res As Integer >> Dim numriga As integer >> TotRow=me.ListCount >> for i=0 to TotRow -1 >> If ListBox1.Cell(i,1) = "Pippo" then >> g.ForeColor=RGB(255,176,98) //Arancio >> g.FillRect(0,0,g.Width,g.Height) >> end if >> next >> ...ma non funzionava (vengono colorate tutte le righe pur intercettando >> l'if >> >> >> Per farlo funzionare ho dovuto aggiungere if row =... >> Dim i, TotRow, res As Integer >> Dim numriga As integer >> TotRow=me.ListCount >> for i=0 to TotRow -1 >> If ListBox1.Cell(i,1) = "Pippo" then >> numriga = i >> if row = numriga then >> g.ForeColor=RGB(255,176,98) //Arancio >> g.FillRect(0,0,g.Width,g.Height) >> end if >> end if >> next >> > > > > -- Massimo |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: ListBox, Gilberto De Faveri |
|---|---|
| Next by Date: | Creare blocchi dati (matrice), Ivano Monti |
| Previous by Thread: | Re: Listbox colorazione riga subordinata a contenuto cella, Massimo Valle |
| Next by Thread: | ListBox, luigi.giammarco@libero.it |
| Indexes: | [Date] [Thread] [Top] [All Lists] |