Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RemoveItem

Status
Not open for further replies.

BRADLEY21

Programmer
Sep 19, 2002
35
US
Why does this not work?

This.RemoveItem(this.ItemIdToIndex)

I know the above is wrong but I figure this will tell you what I am trying to do. I have this in the DBLClick method.
 
BRADLEY21 (Programmer) Feb 6, 2003
Why does this not work?

This.RemoveItem(this.ItemIdToIndex)

Can be number of reasons.
The most common cause - list item with this index no longer exist.
Another - syntax:
it should be either

Code:
THIS.RemoveItem(THIS.ListIndex)

or

Code:
THIS.RemoveListItem(THIS.ListItemID)

(I never used this second one.)

And what the error message reads anyway?

Regards,

Ilya
 
The syntax should have been

Code:
THIS.ItemIDToIndex(nItemID)

Therefore, the Bradley's code line should be

Code:
This.RemoveItem(this.ItemIdToIndex(this.ListItemID))

shouldn't it?

Side remark: IMHO, it's a bit too complex, I'd prefer

Code:
this.RemoveItem(this.ListIndex)

especially considering that this is DoubleClick event, and the item to remove has been thus already selected. But that's my personal preference, though. [smile]

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top