Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlexGrid MouseRow property returns wrong value

Status
Not open for further replies.

Mystic1112

Programmer
Jan 2, 2004
20
0
0
US
I have a MS Hierarchical FlexGrid (MSHFlexgrid) that displays data from an ADO recordset. The grid is not bound to the recordset, I insert the data a row at a time using the AddItem method. I would like to provide users with the ability to move the columns around per the example on MSDN "Sorting and Merging Data in the Hierarchical FlexGrid".

However, when I attempt to read the MouseRow and MouseCol properties in the MouseDown event, I get the same (incorrect) row and column every time.

Can anyone point me to in-depth data about the FlexGrid? Has anyone seen this kind of problem before, i.e. the MouseRow and MouseCol properties not reflecting the location properly?

I have already checked out the FAQ 222-3262, but it doesn't address this issue.

Thanks in advance for any assistance.
Erika
 
I just set up a test - it worked perfectly.

I am running VB6 (SP6).

Can you please run a simple test with a new project, just containing a HFlexgrid and a MouseDown event containing a Debug.Print statement showing the .MouseCol and Row.

What version and SP are you running for VB?

Cheers.

"Life is full of learning, and then there is wisdom"
 
Thank you for the response Koala15.

Here's something weird. If I run the app, break inside the mouseDown event, and view the MouseRow/Col properties by hovering I see incorrect values and it doesn't perfom the movement. However, if I run the app without break points using a debug.print statement to get the MouseRow/Col it gets the expected values (zero and some col number).

So, it appears that there's something amiss about viewing the value of those properties by hovering in the VB dev environment.

It's working now, but I'm still curious about the different Hover vs. Debug.Print outputs. Any insight on that?
 
I wonder if the MouseRow (Col) is being updated asynchronously, so that when the mouse is moved to hover over the field in the IDE, the MouseRow (Col) will show the last values as the mouse leaves the control.

Hmmmmmm .......

"Life is full of learning, and then there is wisdom"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top