netbrfakes Posted March 26, 2015 at 08:15 AM Report Share #580235 Posted March 26, 2015 at 08:15 AM Boa noite, preciso de uma ajuda nesse codigo If Not T_separar.Text Is Nothing Then Dim toremovelist As New List(Of String) For Each item As String In ListBox1.Items If item.Contains(T_separar.Text) Then toremovelist.Add(item) ListBox2.Items.Add(item) End If Next For Each removeitem In toremovelist ele funciona porem ele busca na linha toda, eu preciso , que ele faca a busca apenas no 1 numero da linha porem salve a linha toda , ex 42362387358 42342342342 58963893900 46378687990 68993988298 79836792737 Caso eu coloque no textbox, o numero 4 ele pegue apenas os que tem o numero 4 no inicio , e salve a linha toda e assim por diante! Link to comment Share on other sites More sharing options...
informaster Posted March 26, 2015 at 08:53 AM Report Share #580237 Posted March 26, 2015 at 08:53 AM Bom dia Penso que tenhas que fazer: Listbox.items.remove <> 4 Estilo remover tudo o que é diferente de 4 Como estou no telemóvel não consigo testar Mas procura no Google "vb.net listbox área remove numbers except one" Para ser o primeiro número tens que usar o index(0) da linha (0) primeiro (1) segundo Etcetc Tens um erro em cima pois estou a teclar no tlm "area"=array Nuno Revez @informaster Link to comment Share on other sites More sharing options...
Solution ribeiro55 Posted March 26, 2015 at 09:18 AM Solution Report Share #580239 Posted March 26, 2015 at 09:18 AM Então... faz o teste lógico só no primeiro caractere: For Each Itm As String In ListBox1.Items If Itm(0) = T_separar.Text Then Stop 'faz o que tens a fazer End If Next Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
netbrfakes Posted March 26, 2015 at 05:06 PM Author Report Share #580265 Posted March 26, 2015 at 05:06 PM Nao funcioa nenhum dos exemplos acima! Link to comment Share on other sites More sharing options...
ribeiro55 Posted March 26, 2015 at 05:21 PM Report Share #580268 Posted March 26, 2015 at 05:21 PM Se não funciona contigo é porque alguma coisa estás a fazer mal. http://download.sergioribeiro.com/misc/pq.JPG E se não partilhares a razão, não conseguimos ajudar 🙂 Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
netbrfakes Posted March 27, 2015 at 01:43 PM Author Report Share #580330 Posted March 27, 2015 at 01:43 PM Acho que o stop do 1 codigo que estava a atrapalhar Seguindo esse modelo deu certo! Obrigado 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