help Items

Posts 1–15 of 32 · Page 1 of 3
help Items
hello MPGH coder VB 2008
i want help from you
how i can count number the items in The listbox ??
///
and how i can find the New items added


thank you
Quote Originally Posted by mo3ad001 View Post
hello MPGH coder VB 2008
i want help from you
how i can count number the items in The listbox ??
///
and how i can find the New items added


thank you
To count the items in the listbox use:

Code:
Msgbox(Listbox1.Items.count)
To count new items added, you need a counter that keeps track of the items that are in the list before the user or you add a new item to the list. Then after the new items are added, you just subtract them which will give you new items added. For example:

Code:
Dim olditems as integer=7

Sub Button1_click
Listbox1.items.add("XXX")
Listbox1.items.add("XXX")
Listbox1.items.add("XXX")
Listbox1.items.add("XXX")
Msgbox ("Number of new items added: " & Listbox1.items.count - olditems)
End Sub

The above written code is just a sample to give you an idea !!

Hope this helps !!
Quote Originally Posted by Hassan View Post
To count the items in the listbox use:

Code:
Msgbox(Listbox1.Items.count)
To count new items added, you need a counter that keeps track of the items that are in the list before the user or you add a new item to the list. Then after the new items are added, you just subtract them which will give you new items added. For example:

Code:
Dim olditems as integer=7

Sub Button1_click
Listbox1.items.add("XXX")
Listbox1.items.add("XXX")
Listbox1.items.add("XXX")
Listbox1.items.add("XXX")
Msgbox ("Number of new items added: " & Listbox1.items.count - olditems)
End Sub

The above written code is just a sample to give you an idea !!

Hope this helps !!
thank you for first code
but the second .... not this what i want
i ask t listbox2 show me the new just
that will be like this [ but now vb Codes]
[php]
listbox2.items.Remove (listbox1.items) ' the listbox2 have the new items

[/php]
and then show me the new Items but i don't know you to do that in v thx
Quote Originally Posted by mo3ad001 View Post
thank you for first code
but the second .... not this what i want
i ask t listbox2 show me the new just
that will be like this [ but now vb Codes]
[php]
listbox2.items.Remove (listbox1.items) ' the listbox2 have the new items

[/php]
and then show me the new Items but i don't know you to do that in v thx
What??????

Do you want all items that are in listbox1 to be deleted in listbox2? Please use proper English
Quote Originally Posted by mo3ad001 View Post
thank you for first code
but the second .... not this what i want
i ask t listbox2 show me the new just
that will be like this [ but now vb Codes]
[php]
listbox2.items.Remove (listbox1.items) ' the listbox2 have the new items

[/php]
and then show me the new Items but i don't know you to do that in v thx
////
Quote Originally Posted by mo3ad001 View Post
thank you for first code
but the second .... not this what i want
i ask t listbox2 show me the new just
that will be like this [ but now vb Codes]
[php]
listbox2.items.Remove (listbox1.items) ' the listbox2 have the new items

[/php]
and then show me the new Items but i don't know you to do that in v thx
Quote Originally Posted by Blubb1337 View Post
What??????

Do you want all items that are in listbox1 to be deleted in listbox2? Please use proper English
something like that
i have items in listbox1 and items in listbox2 [ new otems with the old ]
and i wanna see just the new items with out the old ////yea
What defines an "old" item?
Listbox/listview items start at "0"

First item = item 0
second item = item 1

Just as additional information.
What do you want o_O?
Quote Originally Posted by Blubb1337 View Post
What do you want o_O?
this what i wanna do
why


i hope to understand what i mean
Quote Originally Posted by mo3ad001 View Post
this what i wanna do
why


i hope to understand what i mean
and Help " who "
Dude that doesn't even make sense, what defines an old item? How are the items added. Basically.

WHAT.THE.FUCK?
Quote Originally Posted by Jason View Post
Dude that doesn't even make sense, what defines an old item? How are the items added. Basically.

WHAT.THE.FUCK?
what your problem with new items added ...
i want help how i can found the new items added in the listbox2
and not found in the listbox1 ...

how the items added By the Search
Code:
listbox3.items.clear
For each item as string in listbox2.items

if not listbox1.items.contains(item) then
listbox3.items.add(item)
end if

next
?????
Posts 1–15 of 32 · Page 1 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?