ListView

  • Thread starter Thread starter mick
  • Start date Start date
M

mick

Been messing around with the ListView control today and noticed
that given that I have items

"Item 1"
"Item 2"
"Item 3"

in the list, when I use the ListView.FindItemWithText() and pass in an empty
string it returns the first item rather than null. Is this how it should be
and if so
why?

mick
 
mick said:
Been messing around with the ListView control today and noticed
that given that I have items

"Item 1"
"Item 2"
"Item 3"

in the list, when I use the ListView.FindItemWithText() and pass in an empty
string it returns the first item rather than null. Is this how it should
be and if so why?

Yes, it's supposed to work that way. Because FindItemWithText() isn't a
string equality operation, but rather a string "begins with" operation.
And of course, every string starts with "" (i.e. you can represent any
given string in the form "" + <some other string>).

Pete
 
Peter Duniho said:
Yes, it's supposed to work that way. Because FindItemWithText() isn't a
string equality operation, but rather a string "begins with" operation.
And of course, every string starts with "" (i.e. you can represent any
given string in the form "" + <some other string>).

Thanks for clearing that up.

mick
 
Back
Top