The ItemFromPoint property retrieves 0. What am I doing wrong?
The ItemFromPoint property requires the X and Y coordinates in control client coordinates. The coordinates also should be pixels coordinates. The VB environment uses twips instead pixels and therefore the coordinates passed to ItemFromPoint property should be converted from twips to pixels. The VB provides an object Screen, that exports properties like TwipsPerPixelX and TwipsPerPixelY. Use these properties to convert the twips coordinates to pixels coordinates. So, X becomes X / Screen.TwipsPerPixelX, and Y becomes Y / Screen.TwipsPerPixelY. The Access environment doesn’t provide any Screen object, and you need to use the function that’s provided in our free page. Anyway, how to make sure that the ItemFromPoint property is working? Simple. Hides the HeaderBar using the HeaderVisible property and print the ItemFromPoint(2,2,c). The property retrieves the handle for the first visible item. If you give right coordinates to the ItemFromPoint property you get the properly item’s handle.
Related Questions
- I have an exGrid into a property page ( I am using Visual C++ ) and when I use OleCreatePropertyFrame method the property page is not opened. What I am doing wrong?
- It looks like the exHistogramNoGrouping is not working when using the exHistogramCheckedItems in the HistogramView property. What am I doing wrong?
- The ItemFromPoint property retrieves 0. What am I doing wrong?