ListeView

bendaly Messages postés 10 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 22 janvier 2009 - 26 déc. 2008 à 05:52
cs_fauve Messages postés 661 Date d'inscription vendredi 2 décembre 2005 Statut Membre Dernière intervention 23 mars 2011 - 22 janv. 2009 à 22:15
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Cmaher_b%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-ansi-language:FR-CA;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->

Bonjour,


   Je cherche comment mettre en couleur toute la ligne d'un ListeView
(Texte + la casse a cochée). ListeView1.Items.Item(0).BackColor permet de
mettre en couleur juste le texte. Comment faire pour mettre aussi en couleur
la casse a cochée




 







 






Merci

4 réponses

MOUSSAOUIAAZIZ Messages postés 48 Date d'inscription samedi 5 août 2006 Statut Membre Dernière intervention 9 novembre 2009
26 déc. 2008 à 10:53
Salut;


ce n'est pas possible de faire ca avec une (ListeView ), mais tu peu le faire avec MSFlexgrid , et voici  quelques morceaux de codes pour mieux apprendre a connaitre c composant.
http://www.vbfrance.com/codes/COMPOSANT-MSFLEXGRID_4324.aspx
0
cs_fauve Messages postés 661 Date d'inscription vendredi 2 décembre 2005 Statut Membre Dernière intervention 23 mars 2011 8
14 janv. 2009 à 22:22
Salut,

Je ne suis pas d'accord avec toi MOUSSAOUIAAZIZ, avec une ListView, on peut sans aucun problème colorer chaque ligne d'une couleur différente. Cependant si la ListView a des checkbox (Propriété CheckBoxes à True), effectivement, ceux-ci ne seront pas colorer.

La solution pour parvenir a tes fins serait de rajouter des CheckBox dynamiquement dans une colonne de la ListView tu pourras ainsi colorer chaque CheckBox en utilisant sa propriété BackColor.

Si tu souhaites avoir un exemple, tu peux faire signe

++

Fauve

<hr size="2" width="100%" />
Pensez : Réponse Acceptée 
0
bendaly Messages postés 10 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 22 janvier 2009
22 janv. 2009 à 17:43
Salut,

   fauve, peux-tu me donner un exemple..Merci
0
cs_fauve Messages postés 661 Date d'inscription vendredi 2 décembre 2005 Statut Membre Dernière intervention 23 mars 2011 8
22 janv. 2009 à 22:15
Salut,

Bien sur, voici un exemple :




' Colore en bleu la première ligne

ListView1.Items(0).BackColor =  Color.Blue

' Colore en rouge la deuxième ligne
ListView1.Items( 1 ).BackColor  = Color.Red





++

Fauve

<hr size="2" width="100%" />
Pensez : Réponse Acceptée 
0
Rejoignez-nous