Click here to get your copy of REALbasic

ListBox Hover Cell

Posted on March 25, 2008 
Filed Under REALbasic Tutorial

Here’s another REALbasic tip that could make your listboxes better…

Someone from the RB Forum asked how to know when the mouse is over the cell in a listbox. They wanted to show the original value in a static text as the mouse hovers over the cells in a certain column.

That’s a screenshot of the example program I put together that shows how to accomplish that (the cursor didn’t show in the screen capture, but it’s there pointing at the cell showing Eleven).

I did change the original poster’s requirements, though — I made a window that hovers show up rather than just putting the info in a static text control.

The “magic” that allows this to happen is ListBox.RowFromXY and ListBox.ColumnFromXY — it’s not rocket science after all! =:)

You can grab the sample source code for this REALbasic tutorial from here:

http://rbnation.com/files/ListBoxHoverCell2.zip

And then look in the ListBox.MouseMove event for the code to see what’s happening.

There have been times when I’ve wanted this kind of functionality, but never took the time to see what it would take to make it work. Who knew it would be so easy? =;)

Jay Jennings

PS – No video with this one, but more REALbasic tutorial videos are on the way.

Technorati Tags: ,

Click here to get your copy of REALbasic

Comments

2 Responses to “ListBox Hover Cell”

  1. Alexei Vinidiktov on March 26th, 2008 8:24 am

    Thanks, Jay. I appreciate your tips.

  2. Christian on March 27th, 2008 1:15 am

    Thanks jay, very cool!

Leave a Reply