all groups > c# > october 2006 >
You're in the

c#

group:

Bug in ListBox.IndexFromPoint ?


Bug in ListBox.IndexFromPoint ? Michael A. Covington
10/3/2006 9:59:40 PM
c#: When capturing a MouseDown event on a ListBox, I want to find out which list
item the mouse is on. So I do this:

int i = listBox1.IndexFromPoint(e.X,e.Y);

A click on a nonexistent item (e.g., a listbox from which everything has
been deleted) gives i=65535 but ListBox.NoMatches = -1.

If I say this:

int i = (int16) listBox1.IndexFromPoint(e.X,e.Y);

then I get -1 for nonexistent items as I should. This is in VS 2005.


Re: Bug in ListBox.IndexFromPoint ? Cor Ligthert [MVP]
10/4/2006 12:00:00 AM
Michael,

There is a special website to report bugs.
http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220

Cor


"Michael A. Covington" <look@www.covingtoninnovations.com.for.address>
schreef in bericht news:%234wSJk15GHA.1248@TK2MSFTNGP03.phx.gbl...
[quoted text, click to view]

Re: Bug in ListBox.IndexFromPoint ? Michael A. Covington
10/4/2006 9:52:51 AM
Thanks. In fact they're on it:

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=116629

but I think I'll give them my workaround (with int16).

[quoted text, click to view]

AddThis Social Bookmark Button