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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse icon on grid

Status
Not open for further replies.

EMJULIAN

Programmer
Aug 14, 2002
45
US
I have a form with a grid that clicking on the header of each column changes the index on the grid to sort by that columns information (last name, first name, etc). I use 2 forms with the same grid on each. On one form when I move the mouse over the header the icon changes to a black arrow pointing down (south), but on the other form (same grid layout) it does not. I don't know how I got the icon to change on the one grid, but I'd like to do it on the other. Any ideas?

Thanks
Eve
 

In the grid init event:

this.MousePointer = 14

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Eve,

What you described is normal behaviour. You get the south-pointing arrow in the column headers of all grids by default. You must have done something in the second grid to override it. Is it possible that you have got code in a MouseOver event somewhere, or that you have changed a MousePointer or MouseIcon property?

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Thanks for the replies. I checked all through the form and can find no code at all that changes the mouse pointer or mouse icon, and I checked the properties of every item, also zilch. I tried putting "this.mousepointer=14" and also 0 in the init of the grid, and in the init of the form. All the grids on the form are still doing the same thing - over the header it's a white NW arrow and over the text it's a text bar. I should mention that I'm using page frames on this form, but not on the other (where the grid that works correctly). Could this have anything to do with it???

Thanks!
Eve
 
Eve,

The fact of the grid being in a page frame won't make any difference.

The place to put "this.mousepointer=14" is in the MouseEnter event of the Header1 within the column of the grid. You would have to change it to THIS.parent.parent.Mousepointer = 14, as it is the entire grid that holds the Mousepointer property. You would also need to put it back 0 in the Header1's MouseLeave.

But I can't see why it is necessary to do that. I wish knew you why the default behaviour is not working for you.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
I am getting an error when I try to set the mousepointer to 14. I put it in mouseenter of the header of my grid as "this.parent.parent.mousePointer=14". The error is "Error with GRID - Mousepointer: Expression evaluated to an illegal value".

What did I do wrong??

Thanks!
Eve
 
Eve,

Can't see anything wrong with your code. 14 is not an illegal value for MousePointer (at least, not in VFP 6.0 or later).

But in any case, as I mentioned earlier, I don't think this is the correct solution to your original problem. You should be seeing the arrow by default. The problem is that there is something in one of your grids which is overrriding that.

Would it be possible to start again. Drop your base grid class onto a form. Assuming you can see the desired mouse pointer, gradually add the features that you need to the grid until the pointer no longer shows up. That will tell you what was causing the problem in the first place.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top