Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The ItemFromPoint property retrieves 0. What am I doing wrong?

doing Property retrieves wrong
0
Posted

The ItemFromPoint property retrieves 0. What am I doing wrong?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123