Link to home
Start Free TrialLog in
Avatar of GEOFS
GEOFS

asked on

Visual FoxPro grid question

What is the best way to detect whether or not a VFP9 grid has the focus?

I want to be able to open a form containing several grids, each showing its column headers and one row of data, then expand a grid when it gets focus and shrink it back to its original size when it loses focus.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jrbbldr
jrbbldr

Pavel's answer is correct, but you have to ask yourself if that is REALLY what you want to do.
What will dynamically changing one Grid's height do to the appearance of the other parts of your Form?

Other approaches might include:
1)   Stack your full-sized Grids one on top of the other and then use a button group on your form to allow the user to select which Grid they want.  
       When selected, you can bring that Grid forward above the others.
2)  Put full-sized Grids on separate Tab pages of a Form's PageFrame with each PageFrame tab caption identifying which Grid it will display.

Good Luck
Avatar of GEOFS

ASKER

jrbbldr - Well, no, I'm not REALLY sure that's what I want to do, but I won't know for sure without trying it and I couldn't try it without a way to know when a grid get the focus.  I appreciate the other design ideas that you suggested.

Pavel - I will try it using the WHEN and VALID events as soon as I can and report back.
Avatar of GEOFS

ASKER

Thanks, Pavel, for your tip.