Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Disable close box

Posted on 2001-06-06
3
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
sloeber earned 120 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 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