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:
00194097
Views:
15
>How can you tell if the close button was used to close a browse window. Want to treat close like an , 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.

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...

HTH,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform