> > >My screen includes a list box allowing the user to edit an array of > > >existing data. There are more rows of data than will fit into the control > > >so the screen position of an array element will vary depending on how the > > >data has been scrolled. > > > > > >I want to show a second list box of suggested choices each time an item is > > >selected. I would like to position the second list to the right and just > > >above or just below the selection in the first list. (Like Foxpro does it > > >when one edits code in a form and hits the dot after "thisform".) > > > > > >I believe I will be able to programmatically create and place the > > >suggestions box but have not been able to figure out programmatically > > >where the selection on the first screen is positioned. > > > > Some combination of the X/Y coordinates in the listbox's MouseDown Event > > and the OBJTOCLIENT() function should get it for you.
>What you are suggesting should get me the position on the screen but it >won't tell me how much the list has scrolled. Another gotcha is that >scrolling and selection can happen from the keyboard without any mouse data >at all. It seems to me there must be a way to do it as VFP itself does it >with it's object help system. The Click() event fires when you use the arrow keys to move up or down in the listbox. You can: Calculate the height of a row Keep track of the ListItemID selected each time the user either clicks the list with the mouse or uses the arrow keys to move up or down Calculate an offset from these values I don't really see the issue when an item scrolls out of the viewport of the listbox. The user can't select a non-visible item. As long as the item is still selected, it seems to me you should still show your other list at the location it was at when the item scrolled out of view. If the user selects a different, visible, item, then do the positioning based on that. Ken Dibble www.stic-cil.org _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

