Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to show a popupmenu at the cursorposition of a editbox

27 views
Skip to first unread message

Stefan Gevaert

unread,
Apr 11, 2003, 7:43:37 AM4/11/03
to
Hi,

How can I get the row and column values to display a popupmenu, at the
cursorposition (not mouse position) in an editbox. Does anybody have some
ideas?

TIA,

Stefan

Lee Mitchell

unread,
Apr 11, 2003, 4:39:57 PM4/11/03
to
Hi Stefan:

You could use a shortcut menu for the popup, but I don't know how you are
going to get the cursor position within the editbox object itself. Maybe
someone else can shed some light on this point. (I hope I am understanding
the question correctly.)

I looked on the download section of www.universalthread.com and queried on
'popup.' I found numerous popup samples. You might want to look at some
of them to see if they might help.

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

Stefan Gevaert

unread,
Apr 14, 2003, 6:04:38 AM4/14/03
to
Hi Lee,

The goal is to mimic a kind of autocomplete (intellisense) feature. I know
how to display and populate the shortcut menu, but don't know how to display
it at the cursorposition in the editbox.

TIA,

Stefan


"Lee Mitchell" <Le...@microsoft.com> wrote in message
news:gYJ#JqGAD...@cpmsftngxa06.phx.gbl...

Lee Mitchell

unread,
Apr 14, 2003, 11:11:09 AM4/14/03
to
Hi Stefan:

Thanks for the additional information. I went to www.universalthread.com
and searched Download section for examples with the word "autocomplete" in
the summary. I found three examples you might want to look at. Some of
these emulate the autocomplete functionality of our Intellisense. These
example might give you a hint as to how to accomplish this task.

Neil McKamey-Gonzalez

unread,
Apr 15, 2003, 11:07:49 AM4/15/03
to
"Stefan Gevaert" <ste...@fase.be> asked:

> How can I get the row and column values to display a popupmenu, at the
> cursorposition (not mouse position) in an editbox. Does anybody have some
> ideas?

Hi Stefan,

This wouldn't be a problem if VFP included a function that would predict
for us how given text would wrap in a given font at a given width. I've
found that there are a variety of situations where I need to know this.


The only solution I've come up with is to write my own routine to wrap
the code, designed to exactly mimic VFP's wrapping by adding words to a
string one at a time, then checking the string width, and adding a CR
before the word that pushes the current line over the width. If a single
word is wider than the specified width then you need check the width
letter by letter. It's not as slow as it sounds but it might not be fast
enough for your application.

If I can find the time today I'll clean my code up and post it here. If
you don't see it, it's not as much work to write your own as you might
expect.

Hope this helps...
- Neil

0 new messages