Hi all, hope you’re all well.
Is there a way to work out the top, left, width, height of the selected row in a listbox relative to the window it’s on?
Many thanks,
Dave.
Hi all, hope you’re all well.
Is there a way to work out the top, left, width, height of the selected row in a listbox relative to the window it’s on?
Many thanks,
Dave.
What do you miss to do it by yourself ?
You have the Window 0,0,Width and Height,
You have ListBox1.Left,Top, Width, Height,
You have ListBox1.Height,
You have the selectedRow #
RowFromXY(x, y)
etc.
Emile - I was wanting to obtain the bounding rectangle of the selected row… but as I said @KarenA previously posted a solution…
var Y as Integer
If me.Border Then Y = 1
If me.HasHeading Then Y = Y + me.HeaderHeight
Y = Y + (me.ListIndex - me.ScrollPosition)*me.RowHeight
// Y is the top of the selected row, X is easy to work out for yourself.
Dave.
Sorry, I did not saw that post ! Bad vision…