Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Did client use close box to close browse window?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00193981
Message ID:
00194109
Views:
18
>>How can you tell if the close button was used to close a browse window. Want to treat close like an esc, but do not know how to code for it.
>>
>>Open browse window. Esc is a cancel. Rightmouse or Enter is select (on key label ... keyboard ctrl+w). If the client uses the close box I want to treat is like an esc. But how? My current code "if the lastkey = 27 then go oldrecno". But how to know if 27 or close button. Of course the question could be rephrased to ask, how enter or right mouse click?

>I just tried to figure this out, and I think the answer is you can't tell with a browse. You can check for Ctrl-W, Esc, and Ctrl-F4, but if they click on the close box you're outta luck.

>First suggestion: you might start with DEFINE WINDOW MyWin ... NOCLOSE ... and use BROWSE WINDOW MyWin, I think that may give you more control.

Tried setting up a window template and use window MyWin. Can not get the PREFERENCE clause to work with a template. I can only get the PREFERENCE to work if I also use the NORMAL clause. Seems the NORMAL clause will override the NOCLOSE of the window template.

>Next idea: so you're using this browse purely for the purpose of selecting a record (the way we used to frequently in 2.x), right? Is there a really good reason you can't use a combo (style: drop-down list), a grid, or if you really want to stick with a 2.6-ish way, DEFINE POPUP/ON SELECTION POPUP DEACTIVATE POPUP/ACTIVATE POPUP/RELEASE POPUP? Is the list of records to choose from too long for anything but a browse or a grid to work well? And a grid too much overhead for what you're trying to do? Just trying to get a better handle on what you're trying to do and what solutions might work well. Maybe something I said will set you on the path...

Have too many browses (30 or so) to try an get too fancy. Client wants cancel out of the browse with a mouseclick (want to code close button like esc), and client wants browse size to be saved. So far no luck on either.

Rock and hard spot

Brenda
Previous
Reply
Map
View

Click here to load this message in the networking platform