General information
Category:
Forms & Form designer
>>>Greg,
>>>
>>>Did you look at OBJTOCLIENT() function?
>>>
>>>>I have a rather sophisticated object oriented drag and drop scheduling application. There is an object for each day of the week and then inside each of those days objects are created and positioned on the fly. I have a find function in which I would like to position the mouse pointer on the correct object once the item is found.
>>>>
>>>>My issue is that I'm nested deep down in objects so I want a clean, easy way to determine the absolute screen coordinates for my MOUSE AT command from the nested down object without having to complicate things.
>>>>
>>>>In my processing routine I have a direct variable to my found item.
>>>>
>>>>loSchObj.top will give me the top in relation to the day I'm on, but that's not good enough and I don't want to have to keep looking up parents to find what values I need. I'm pretty sure there is a simple way to do this but I just can't remember how.
>>>>
>>>>Hope I'm making sense... I'd appreciate any help in making this simple update.
>>>>
>>>>Thank You in advance!!!!
>>
>>I'm looking at it right now. I think that will do the job!!! This is the code I came up with on a first draft...
>>
>>lnTopOffset = thisform.top + objtoclient(this,1)
>>lnLeftOffset = thisform.left + objtoclient(this,2)
>>mouse at lnTopOffset,lnLeftOffset Pixels
>>
>>
>>Once again, you guys have save me a bunch of time!!!!!
>
>
>HMMM, now I'm confused once again.
>
>When I tested on just a regular for with a few test buttons everything was fine. But now when I'm putting it into my real world solution I'm always getting a 0 back from objtoclient(loObj,1) and objtoclient(loObj,2). I've put it in a trace and watched it but no matter where the form is or where the object is on the form I'm always getting a 0 from this function. Any ideas?
Sorry to waste your time guys... I figured it out. I had placed my code after the object was created and built but before I had positioned it in the proper location in the "scheduling day" object. That is why it was always 0!!!!
Thanks for the help!! It's working perfectly now!!
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only