Jump to content

[Resolvido] Manipulação de List boxs

Recommended Posts

Podes fazer algo assim:

' Se tiver algum item selecionado na lista 1
If List1.ListIndex >= 0 Then
Dim i As Integer
' Passa por todos os items da lista 1
While i < List1.ListCount
	' Se o item estiver selecionado
	If List1.Selected(i) Then
		' Adiciona o item à lista 2
		List2.AddItem List1.List(i)
		' Remove o item da lista 1
		List1.RemoveItem (i)
		' Se não estava selecionado, passa para o item seguinte
		i = i + 1
	End If
End If
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.