On 27-Feb-09, at 7:37 AM, Christian Dorn wrote:
Am 27.02.2009 um 15:18 schrieb Greg O'Lone:
Interestingly, if you try to do this:
dim col as integer
col = me.ColumnFromXY(x,y)
in the MouseDown event, you get -1 I'd expect it to be able to
figure out which column you clicked....
Yes, I found this, too. But you can get the right column by adding
up the WidthActual properties of the columns:
dim column, w, count as Integer
column = -1
count = me.ColumnCount-1
for i as Integer = 0 to count
w = w + me.Column(i).WidthActual
if w >= x then
column = i
exit
end if
next i
Or adjust Y so it's in the content area of the listbox
dim col as integer
col = me.ColumnFromXY(x,headerHeight + 1)
Once you have data in a listbox code like this will figure out the
headherheight
dim headerHeight as integer = 0
if listbox1.hasHeading then
dim i as integer = listbox1.rowFromXY(1,headerHeight)
while listbox1.rowFromXY(1,headerHeight) < 0
headerHeight = headerHeight + 1
wend
headerHeight = headerHeight - 1
end if
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|