Solved

Disable close box

Posted on 2001-06-06
3
179 Views
Last Modified: 2013-12-18
Is there any way to prevent users from closing a form using Escape or the close button (top right). I have a Close button which I want them to use instead.

I have tried putting code into the Queryclose event, but once this event is started, can it be stopped?

Thanks,
Andrew.
0
Comment
Question by:ANDREAG
3 Comments
 
LVL 4

Accepted Solution

by:
sloeber earned 30 total points
ID: 6159698
How do you force a user to use a button to close a form?

This code satisfies three requirements:
1) prevent users from closing a form via menu or keyboard controls; only the action button can be used for closing
2) only use ONE field to accomplish to keep application overhead down
3) depending on a value in a status field, action button should issue file close

AllowClose field: Editable, Text, Hidden


  Default value = "0"
  Validation = @If(AllowClose = "0"; @Failure(...); @Success)
Action Button:
  FIELD AllowClose := "1";
  ...........

Form PostOpen Event:
  FIELD AllowClose := "0";
  @SetField("AllowClose"; "0")

That's all

Greets,
Sloeber



0
 

Expert Comment

by:KAK
ID: 6161021
If you would like to let the user know why they can't close with ESC, build on the solution provided by sloeber by adding a return message to @Failure in the Input Validation foumula.  

Example: @If(AllowClose = "0"; @Failure("Please use the \'\'Close\'\'  button to close this document."); @Success)
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6173221
make sure that you use the continue = False to stop from the form being closed after checking the field value set by the @functions in the previous events.

-Arun
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now