Anamotiris Posted March 20, 2008 Report Share Posted March 20, 2008 Alguem me poderia ajudar no seguinte se adicinar algo a uma listview 1º se nao existir esse item entao adiciona-o senao (como ja existe, nao adiciona) Resultado: evita ter dois items iguais na listview. obrigado pela vossa colaboração abraço Link to comment Share on other sites More sharing options...
Asgorath Posted March 20, 2008 Report Share Posted March 20, 2008 Boas. Podes usar o .Contains()) para validar se a coluina ja tem o valor. "The Dark Side Clouds Everthing. Impossible To See The Future Is."My rig: Intel Core 2 Quad Q9450 | abit IP35P | 4G Kingston 800 Mhz | XFX GeForce 9800 GX2 1G ddr3 | 2X WD5000AAJS 500Gb Sata 2 | PSU 600W || Caixa El-Diablo | Creative XMod Link to comment Share on other sites More sharing options...
jpaulino Posted March 20, 2008 Report Share Posted March 20, 2008 Olá, Podes fazer assim: [code=vbnet]Dim item As ListViewItem = Me.ListView1.FindItemWithText("Texto a Procurar") If item Is Nothing Then Debug.Print("Item não encontrado") Else Debug.Print("Item encontrado") End If [/code] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now